2020-07-20 20:03:08 +02:00
|
|
|
FROM golang:latest as builder
|
|
|
|
RUN mkdir -p /go/src/folder
|
|
|
|
WORKDIR /go/src/folder
|
|
|
|
COPY /src .
|
2020-07-20 18:06:32 +02:00
|
|
|
|
2020-07-20 20:03:08 +02:00
|
|
|
RUN go get -d
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o main .
|
2020-07-20 19:42:18 +02:00
|
|
|
|
2020-07-20 20:03:08 +02:00
|
|
|
FROM alpine:latest
|
|
|
|
WORKDIR /
|
|
|
|
COPY --from=builder /go/src/folder/main .
|
|
|
|
EXPOSE 8080
|
2020-07-20 18:06:32 +02:00
|
|
|
|
2020-07-20 20:03:08 +02:00
|
|
|
CMD ["/main"]
|