source: code/trunk/Dockerfile@ 91

Last change on this file since 91 was 91, checked in by alex, 6 years ago

Dockerfile: create and use a morty user.

File size: 498 bytes
Line 
1# STEP 1 build executable binary
2FROM golang:alpine as builder
3
4WORKDIR $GOPATH/src/github.com/asciimoo/morty
5
6RUN apk add --no-cache git
7
8COPY . .
9RUN go get -d -v
10RUN go build .
11
12# STEP 2 build the image including only the binary
13FROM alpine:latest
14
15EXPOSE 3000
16
17RUN apk --no-cache add ca-certificates
18
19RUN adduser -D -h /usr/local/morty -s /bin/sh morty morty
20
21USER morty
22
23COPY --from=builder /go/src/github.com/asciimoo/morty/morty /usr/local/morty/morty
24
25ENTRYPOINT ["/usr/local/morty/morty"]
Note: See TracBrowser for help on using the repository browser.