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
RUN mkdir /src
ADD . /src
WORKDIR /src
FROM golang:latest as builder
RUN mkdir -p /go/src/folder
WORKDIR /go/src/folder
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
RUN go get -u ./...
RUN go build -o main .
ENTRYPOINT ["/src/main"]
CMD ["/main"]