mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
This brindgs connlib from its own separated repo to firezone's monorepo.
On top of bringing connlib we also add and unify the Dockerfile for all
rust binaries and add a docker-compose that can run a headless client, a
relay and a gateway which eventually will test the whole flow between a
client and a resource. For this to work we also incorporated some elixir
scripts to generate portal tokens for those components.
22 lines
646 B
Docker
22 lines
646 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 \
|
|
--mount=type=cache,target=/usr/local/rustup \
|
|
apt update && apt install -y musl-tools && \
|
|
cargo build -p $PACKAGE --release --target x86_64-unknown-linux-musl
|
|
|
|
RUN --mount=type=cache,target=./target \
|
|
mv ./target/x86_64-unknown-linux-musl/release/$PACKAGE /usr/local/bin/$PACKAGE
|
|
|
|
FROM alpine:3.18
|
|
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}
|