mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
There are problems building the docker images in macos using musl due to ring's problems therefore we started using slim-debian with glibc for development.
21 lines
571 B
Docker
21 lines
571 B
Docker
FROM rust:1.70-slim as BUILDER
|
|
ARG PACKAGE
|
|
WORKDIR /build/
|
|
COPY . ./
|
|
RUN --mount=type=cache,target=./target \
|
|
--mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
|
|
--mount=type=cache,target=/usr/local/rustup,sharing=locked \
|
|
cargo build -p $PACKAGE --release
|
|
|
|
RUN --mount=type=cache,target=./target \
|
|
mv ./target/release/$PACKAGE /usr/local/bin/$PACKAGE
|
|
|
|
FROM debian:11.7-slim
|
|
ARG PACKAGE
|
|
WORKDIR /app/
|
|
COPY --from=BUILDER /usr/local/bin/$PACKAGE .
|
|
ENV RUST_BACKTRACE=1
|
|
ENV PATH "/app:$PATH"
|
|
ENV PACKAGE_NAME ${PACKAGE}
|
|
CMD ${PACKAGE_NAME}
|