-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Viet Anh Duong <[email protected]>
- Loading branch information
1 parent
499cf04
commit 36a7dbe
Showing
5 changed files
with
34 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,7 @@ go.work | |
/.vscode | ||
|
||
.DS_Store | ||
|
||
# The following files get created during image builds | ||
.buildx | ||
.buildx_builder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
FROM golang:1.21 as builder | ||
FROM --platform=${TARGETPLATFORM} golang:1.21 as builder | ||
|
||
WORKDIR /src | ||
|
||
COPY . . | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o ./dist/compiler ./cmd/compiler | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
FROM ghcr.io/vietanhduong/wbpf-llvm:15.0.7 | ||
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -o ./dist/compiler ./cmd/compiler | ||
|
||
FROM --platform=${TARGETPLATFORM} ghcr.io/vietanhduong/wbpf-llvm:15.0.7 | ||
COPY --from=builder /src/dist/compiler /usr/local/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM ubuntu:22.04 as builder | ||
FROM --platform=linux/amd64 ubuntu:22.04 as builder | ||
|
||
ARG LLVM_VERSION=15.0.7 | ||
ENV LLVM_VERSION=${LLVM_VERSION} | ||
|
@@ -11,22 +11,11 @@ RUN /build_llvm_native.sh | |
RUN /build_llvm_cross_aarch64.sh | ||
|
||
FROM ubuntu:22.04 as rootfs | ||
|
||
# Copy amd64 binary | ||
COPY --from=builder /out/linux/amd64/bin/clang /usr/local/bin/clang-amd64 | ||
COPY --from=builder /out/linux/amd64/bin/llc /usr/local/bin/llc-amd64 | ||
COPY --from=builder /out/linux/amd64/bin/llvm-objcopy /usr/local/bin/llvm-objcopy-amd64 | ||
|
||
# Copy amd64 binary | ||
COPY --from=builder /out/linux/arm64/bin/clang /usr/local/bin/clang-arm64 | ||
COPY --from=builder /out/linux/arm64/bin/llc /usr/local/bin/llc-arm64 | ||
COPY --from=builder /out/linux/arm64/bin/llvm-objcopy /usr/local/bin/llvm-objcopy-arm64 | ||
|
||
COPY wrapper.sh /usr/local/bin/clang | ||
COPY wrapper.sh /usr/local/bin/llc | ||
COPY wrapper.sh /usr/local/bin/llvm-objcopy | ||
ARG TARGETPLATFORM | ||
COPY --from=builder /out/${TARGETPLATFORM}/bin /usr/local/bin | ||
|
||
FROM scratch | ||
LABEL org.opencontainers.image.source=https://github.com/vietanhduong/wbpf | ||
LABEL maintainer="[email protected]" | ||
# Squash image | ||
COPY --from=rootfs / / |
This file was deleted.
Oops, something went wrong.