yukari/Dockerfile
alex f50aa5ce4f Dockerfile: create and use a morty user.
git-svn-id: file:///srv/svn/repo/yukari/trunk@91 f3bd38d9-da89-464d-a02a-eb04e43141b5
2019-07-02 08:57:42 +00:00

26 lines
498 B
Docker

# STEP 1 build executable binary
FROM golang:alpine as builder
WORKDIR $GOPATH/src/github.com/asciimoo/morty
RUN apk add --no-cache git
COPY . .
RUN go get -d -v
RUN go build .
# STEP 2 build the image including only the binary
FROM alpine:latest
EXPOSE 3000
RUN apk --no-cache add ca-certificates
RUN adduser -D -h /usr/local/morty -s /bin/sh morty morty
USER morty
COPY --from=builder /go/src/github.com/asciimoo/morty/morty /usr/local/morty/morty
ENTRYPOINT ["/usr/local/morty/morty"]