Skip to content

Commit

Permalink
fix: controlplane Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jokestax committed Nov 16, 2024
1 parent 9673c54 commit c28af9e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions build/Containerfile.controlplane
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx-tools

FROM --platform=$BUILDPLATFORM rust:alpine
ARG TARGETPLATFORM
ARG PROJECT_DIR=/workspace
ARG BUILD_DIR=$PROJECT_DIR/build

RUN apk add clang lld
COPY --from=xx / /
RUN apk add --no-cache clang lld
COPY --from=xx-tools / /

WORKDIR /workspace

RUN --mount=type=bind,source=src,target=src \
--mount=type=bind,source=Cargo.toml,target=Cargo.toml \
--mount=type=bind,source=Cargo.lock,target=Cargo.lock \
xx-cargo build --release --target-dir ./build && \
RUN --mount=type=bind,source=../controlplane/src/,target=src \
--mount=type=bind,source=../controlplane/Cargo.toml,target=Cargo.toml \
--mount=type=bind,source=../controlplane/Cargo.lock,target=Cargo.lock \
xx-cargo build --release --target-dir $BUILD_DIR && \
xx-verify ./build/$(xx-cargo --print-target-triple)/release/controller

0 comments on commit c28af9e

Please sign in to comment.