# NOTE: This dockerfile relies on precompiled binaries already existing on the host. # Select the correct binary and put it to a predictable location FROM debian:bullseye-slim as arch-selector ARG TARGETPLATFORM COPY target /tmp/target/ RUN case ${TARGETPLATFORM} in \ "linux/amd64") export RUST_TARGET="x86_64-unknown-linux-gnu" ;; \ "linux/arm64") export RUST_TARGET="aarch64-unknown-linux-gnu" ;; \ esac; \ mv /tmp/target/${RUST_TARGET}/release/clouddns-nat-helper /tmp/clouddns-nat-helper FROM debian:bullseye-slim COPY --from=arch-selector /tmp/clouddns-nat-helper /usr/local/bin/ RUN chmod +x /usr/local/bin/clouddns-nat-helper # run unprivileged USER 1001 CMD ["clouddns-nat-helper"]