20 lines
273 B
Docker
20 lines
273 B
Docker
|
|
FROM golang:1.20
|
|
|
|
WORKDIR /app
|
|
|
|
COPY main.go ./
|
|
# COPY go.sum ./
|
|
# COPY go.mod ./
|
|
RUN go mod init main
|
|
RUN go mod tidy
|
|
# RUN go mod download
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -o main
|
|
|
|
# USER nobody:nobody
|
|
|
|
ENTRYPOINT ["/app/main"]
|
|
|
|
CMD ["/app/main"]
|