Use alpine image and add zip.

This commit is contained in:
Seraphim R. Pardee 2024-09-23 22:30:52 -04:00
parent 8f2ae2a38c
commit 961d4d6495

View File

@ -1,8 +1,6 @@
# Debian GNU/Linux 10 (1.13.10-buster) # Alpine 3.20
FROM golang:latest FROM golang:1.23.1-alpine3.20
RUN apk install --no-cache zip
# add zip
RUN apt install zip
# copy entrypoint file # copy entrypoint file
COPY entrypoint.go /usr/bin/entrypoint.go COPY entrypoint.go /usr/bin/entrypoint.go
@ -10,5 +8,7 @@ COPY entrypoint.go /usr/bin/entrypoint.go
# change mode of the entrypoint file # change mode of the entrypoint file
RUN chmod +x /usr/bin/entrypoint.go RUN chmod +x /usr/bin/entrypoint.go
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /go-xbuild
# set entrypoint command # set entrypoint command
ENTRYPOINT [ "go", "run", "/usr/bin/entrypoint.go" ] ENTRYPOINT [ "/go-xbuild"]