content: FROM public.ecr.aws/amazonlinux/amazonlinux:2023 as server_builder
  
  ENV SHELL="/usr/bin/env bash"
  
  RUN dnf upgrade -y
  RUN dnf install -y git gcc pkgconfig openssl openssl-devel openssl-libs
  RUN dnf install -y time which hostname
  RUN dnf install -y clang clang-devel clang-libs llvm-devel cmake make
  
  ENV RUST_LOG="debug"
  ENV RUST_BACKTRACE="full"
  
  ENV CARGO_HOME="$HOME/rust" RUSTUP_HOME="$HOME/rustup" PATH="$PATH:$HOME/rust/bin"
  RUN curl -fsSL https://sh.rustup.rs | bash -is -- -y --verbose --no-modify-path --default-toolchain stable --profile minimal
  
  
  # Specify path relative to the rbuilds.sh script
  WORKDIR /app-builder
  
  # Copy the source code
  # RUN git clone https://github.com/shivraj-sj/reference_apps.git
  RUN git clone https://github.com/sentient-agi/sentient-enclaves-framework.git
  
  RUN cd /app-builder/sentient-enclaves-framework/reference_apps/inference_server && \
      cargo build --release
  
  FROM public.ecr.aws/amazonlinux/amazonlinux:2023 as enclave_app
  # https://gallery.ecr.aws/amazonlinux/amazonlinux
  
  ENV SHELL="/usr/bin/env bash"
  # ENV RUST_LOG="pipeline=debug"
  ENV RUST_LOG="debug"
  ENV RUST_BACKTRACE="full"
  
  WORKDIR /apps
  RUN dnf upgrade -y
  
  RUN dnf install -y kernel-libbpf systemd systemd-libs systemd-resolved initscripts
  RUN dnf install -y /usr/bin/systemctl
  
  RUN dnf install -y sudo time which hostname tar bsdtar cpio findutils pcre-tools pciutils procps-ng
  RUN dnf install -y iputils iproute dnsmasq bind bind-utils bind-dnssec-utils traceroute net-tools socat nc nmap-ncat
  # RUN dnf install -y kernel kernel-devel kernel-modules-extra kernel-modules-extra-common
  RUN dnf install -y kmod kmod-libs
  RUN dnf install -y nftables iptables iptables-nft iptables-libs iptables-utils iptables-legacy iptables-legacy-libs
  RUN dnf install -y lsof perf iperf iperf3
  RUN dnf install -y --allowerasing curl
  RUN dnf install -y jq wget openssh git rsync
  RUN dnf install -y lynx w3m
  RUN dnf install -y awscli
  
  # Copy the server binary
  COPY --from=server_builder /app-builder/sentient-enclaves-framework/reference_apps/inference_server/target/release/inference_server /apps/inference_server
  
  CMD tail -f /dev/null
  