Fix image build failure on docker hub
This commit is contained in:
parent
d232c3d8a3
commit
c49be85719
|
@ -10,20 +10,21 @@ RUN go get github.com/GeertJohan/go.rice/rice && \
|
||||||
go get github.com/pilu/fresh
|
go get github.com/pilu/fresh
|
||||||
|
|
||||||
ENV GO111MODULE=on
|
ENV GO111MODULE=on
|
||||||
RUN cd serv && rice embed-go
|
|
||||||
RUN go mod vendor
|
RUN go mod vendor
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o service && \
|
RUN rice -i ./serv embed-go && \
|
||||||
|
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o service && \
|
||||||
upx --ultra-brute -qq service && \
|
upx --ultra-brute -qq service && \
|
||||||
upx -t service
|
upx -t service
|
||||||
|
|
||||||
#second stage
|
#second stage
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN apk add --no-cache tzdata
|
RUN apk add --no-cache tzdata
|
||||||
|
|
||||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
COPY --from=builder /app/service .
|
COPY --from=builder /app/service .
|
||||||
COPY dev.yml .
|
COPY --from=builder /app/*.yml ./
|
||||||
|
|
||||||
RUN chmod +x /app/service
|
RUN chmod +x /app/service
|
||||||
USER nobody
|
USER nobody
|
||||||
|
|
Loading…
Reference in New Issue