-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
33 lines (26 loc) · 1.08 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM --platform=$TARGETPLATFORM golang:alpine
ENV CGO_ENABLED 0
ENV GOPROXY https://goproxy.io,direct
LABEL \
org.opencontainers.image.title="jzero" \
org.opencontainers.image.description="jzero framework" \
org.opencontainers.image.url="https://github.com/jzero-io/jzero" \
org.opencontainers.image.documentation="https://github.com/jzero-io/jzero#readme" \
org.opencontainers.image.source="https://github.com/jzero-io/jzero" \
org.opencontainers.image.licenses="MIT" \
maintainer="jaronnie <[email protected]>"
WORKDIR /app
COPY dist/jzero_linux_amd64_v1/jzero /dist/jzero_linux_amd64_v1/jzero
COPY dist/jzero_linux_arm64/jzero /dist/jzero_linux_arm64/jzero
RUN if [ `go env GOARCH` = "amd64" ]; then \
cp /dist/jzero_linux_amd64_v1/jzero /usr/local/bin/jzero; \
elif [ `go env GOARCH` = "arm64" ]; then \
cp /dist/jzero_linux_arm64/jzero /usr/local/bin/jzero; \
fi
RUN apk update --no-cache \
&& apk add --no-cache tzdata ca-certificates protoc \
&& jzero check \
&& rm -rf /dist \
&& rm -rf /go/pkg/mod \
&& rm -rf /go/pkg/sumdb
ENTRYPOINT ["jzero"]