Merge pull request #58 from maximbaz/add-dockerfile

Add Dockerfile
This commit is contained in:
Martin Polden 2018-08-30 15:52:48 +02:00 committed by GitHub
commit 7f538ca24b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

15
Dockerfile Normal file
View File

@ -0,0 +1,15 @@
# Compile
FROM golang:1.11-alpine AS build
ADD . /go/src/github.com/mpolden/echoip
WORKDIR /go/src/github.com/mpolden/echoip
RUN apk --update add git gcc musl-dev
ENV GO111MODULE=on
RUN go get -d -v .
RUN go install ./...
# Run
FROM alpine
RUN mkdir -p /opt/
COPY --from=build /go/bin/echoip /opt/
WORKDIR /opt/
ENTRYPOINT ["/opt/echoip"]