17 lines
278 B
Docker
17 lines
278 B
Docker
|
FROM golang:1.18-alpine AS build_base
|
||
|
WORKDIR /app
|
||
|
|
||
|
RUN apk add git
|
||
|
RUN apk add build-base
|
||
|
|
||
|
COPY go.mod .
|
||
|
COPY go.sum .
|
||
|
RUN go mod download
|
||
|
COPY . .
|
||
|
RUN CGO_ENABLED=1 GOOS=linux go build -o gw ./cmd/gw
|
||
|
|
||
|
FROM alpine:3.9
|
||
|
COPY --from=build_base /app/gw /app/gw
|
||
|
|
||
|
CMD ["/app/gw"]
|