-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (27 loc) · 772 Bytes
/
Dockerfile
File metadata and controls
32 lines (27 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#
# Stage 1
#
FROM library/golang:1 as builder
# Godep for vendoring
RUN go get github.com/tools/godep
# Recompile the standard library without CGO
RUN CGO_ENABLED=0 go install -a std
ENV APP_DIR $GOPATH/src/github.com/chartmuseum/ui
RUN mkdir -p $APP_DIR
ADD . $APP_DIR
# Compile the binary and statically link
RUN cd $APP_DIR && \
GO111MODULE=auto CGO_ENABLED=0 godep go build -ldflags '-w -s' -o /chartmuseum-ui && \
cp -r views/ /views && \
cp -r static/ /static
#
# Stage 2
#
FROM alpine:3.8
RUN apk add --no-cache curl cifs-utils ca-certificates \
&& adduser -D -u 1000 chartmuseum
COPY --from=builder /chartmuseum-ui /chartmuseum-ui
COPY --from=builder /views /views
COPY --from=builder /static /static
USER 1000
ENTRYPOINT ["/chartmuseum-ui"]