mirror of
https://github.com/rjNemo/docker_examples
synced 2026-06-06 02:26:45 +00:00
20 lines
258 B
Docker
20 lines
258 B
Docker
FROM golang:1.18-alpine AS build
|
|
|
|
#ENV CGO_ENABLED 0
|
|
ENV GOOS linux
|
|
ENV GOARCH amd64
|
|
|
|
WORKDIR /app
|
|
|
|
COPY go.* .
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
RUN go build -o ./out/dist .
|
|
|
|
FROM alpine
|
|
|
|
RUN apk upgrade --no-cache
|
|
|
|
COPY --from=build /app/out/dist .
|
|
CMD ./dist
|