-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
30 lines (21 loc) · 791 Bytes
/
Dockerfile
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
FROM golang:alpine AS build-env
LABEL maintainer "Alexander Makhinov <[email protected]>" \
repository="https://github.com/MonaxGT/parsefields"
COPY . /go/src/github.com/MonaxGT/parsefields
RUN apk add --no-cache git mercurial \
&& cd /go/src/github.com/MonaxGT/parsefields/service/parsefields \
&& go get -t . \
&& CGO_ENABLED=0 go build -ldflags="-s -w" \
-a \
-installsuffix static \
-o /parsefields
FROM alpine:3.9
RUN apk --update --no-cache add ca-certificates curl \
&& adduser -h /app -D app \
&& mkdir -p /app/data \
&& chown -R app /app
COPY --from=build-env /parsefields /app/parsefields
USER app
VOLUME /app/data
WORKDIR /app
ENTRYPOINT ["./parsefields"]