16 lines
321 B
Docker
16 lines
321 B
Docker
|
FROM golang:alpine as builder
|
||
|
|
||
|
WORKDIR /builder
|
||
|
COPY . .
|
||
|
RUN apk add upx
|
||
|
RUN go mod download
|
||
|
RUN go build -o app
|
||
|
RUN upx -9 app
|
||
|
RUN ls -lh && chmod +x ./app
|
||
|
|
||
|
FROM code.hyxc1.com/open/alpine:3.16.0 as runner
|
||
|
LABEL org.opencontainers.image.authors="lxh@cxh.cn"
|
||
|
|
||
|
WORKDIR /app
|
||
|
COPY --from=builder /builder/app ./app
|
||
|
CMD ./app
|