Files
quake-kube/Dockerfile
chris f92180af5e 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.
2020-08-17 11:39:13 -04:00

30 lines
867 B
Docker

FROM golang:1.13 as builder
WORKDIR /workspace
COPY go.mod go.mod
COPY go.sum go.sum
ARG GOPROXY
ARG GOSUMDB
RUN go mod download
COPY cmd cmd/
COPY internal internal/
COPY public public/
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
RUN git clone https://github.com/ioquake/ioq3
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-*.so.1 /lib
ENTRYPOINT ["/usr/local/bin/q3"]