Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: controlplane Dockerfile #309

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading