forked from github-mirrorer/quake-kube
Add docker cross-compile for arm64
This makes use of the docker buildx to cross-compile images for amd64/arm64. It is worth noting that there are ongoing issues with the Go compiler and qemu (used by buildx/buildkit) and the solution I ended up using here was to limit the affinity to `go build`. Better solutions may be forthcoming. Refs: https://github.com/golang/go/issues/24656 https://bugs.launchpad.net/qemu/+bug/1696773 This relates to issue #11 regarding container images built for running on Raspberry Pi.
This commit is contained in:
10
Dockerfile
10
Dockerfile
@ -11,19 +11,19 @@ COPY cmd cmd/
|
||||
COPY internal internal/
|
||||
COPY public public/
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o q3 ./cmd/q3
|
||||
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on taskset -c 1 /usr/local/go/bin/go build -a -o q3 ./cmd/q3
|
||||
|
||||
FROM alpine:3.12 as quake-n-bake
|
||||
|
||||
RUN apk add --no-cache git gcc make libc-dev sdl2-dev mesa-dev
|
||||
RUN apk add --no-cache git gcc make libc-dev
|
||||
RUN git clone https://github.com/ioquake/ioq3
|
||||
RUN cd /ioq3 && make
|
||||
RUN cp /ioq3/build/release-linux-x86_64/ioq3ded.x86_64 /usr/local/bin/ioq3ded
|
||||
RUN cd /ioq3 && make BUILD_MISSIONPACK=0 BUILD_BASEGAME=0 BUILD_CLIENT=0 BUILD_SERVER=1 BUILD_GAME_SO=0 BUILD_GAME_QVM=0 BUILD_RENDERER_OPENGL2=0
|
||||
RUN cp /ioq3/build/release-linux-$(uname -m)/ioq3ded.$(uname -m) /usr/local/bin/ioq3ded
|
||||
|
||||
FROM alpine:3.12
|
||||
|
||||
COPY --from=builder /workspace/q3 /usr/local/bin
|
||||
COPY --from=quake-n-bake /usr/local/bin/ioq3ded /usr/local/bin
|
||||
COPY --from=quake-n-bake /lib/ld-musl-x86_64.so.1 /lib
|
||||
COPY --from=quake-n-bake /lib/ld-musl-*.so.1 /lib
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/q3"]
|
||||
|
||||
Reference in New Issue
Block a user