more docker testing

This commit is contained in:
Johannes Theiner 2020-07-20 20:03:08 +02:00
parent 0324b2fc99
commit 6e2437dbdd

View File

@ -1,11 +1,14 @@
FROM golang:1.14.6-alpine3.12 FROM golang:latest as builder
RUN mkdir /src RUN mkdir -p /go/src/folder
ADD . /src WORKDIR /go/src/folder
WORKDIR /src COPY /src .
RUN go get -d
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o main .
FROM alpine:latest
WORKDIR /
COPY --from=builder /go/src/folder/main .
EXPOSE 8080 EXPOSE 8080
RUN go get -u ./... CMD ["/main"]
RUN go build -o main .
ENTRYPOINT ["/src/main"]