# hadolint ignore=DL3007 FROM balenalib/rpi-raspbian:latest AS builder ENV HOME /root WORKDIR /gatekeeper COPY src src COPY rust-toolchain . COPY Cargo.toml . COPY Cargo.lock . RUN update-ca-certificates -f && \ curl -sSfL https://sh.rustup.rs > rustup.sh && \ sh rustup.sh -y --default-toolchain none --profile minimal && \ rm -f rustup.sh ENV PATH $HOME/.cargo/bin:$PATH RUN apt-get update && \ apt-get install -y --no-install-recommends build-essential=* && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* ENV RUSTFLAGS "-Clinker=arm-linux-gnueabihf-gcc" ARG TARGET=arm-unknown-linux-gnueabihf RUN rustup target add "$TARGET" && \ cargo build --target "$TARGET" --release && \ cp "target/$TARGET/release/gatekeeperd" / # hadolint ignore=DL3007 FROM balenalib/rpi-raspbian:latest AS runner COPY --from=builder /gatekeeperd / RUN apt-get update && \ apt-get install -y --no-install-recommends avahi-daemon=* dbus=* libnss-mdns=* && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* EXPOSE 1080 ENV RUST_LOG gatekeeper=info COPY entrypoint.sh / ENTRYPOINT ["/entrypoint.sh"]