-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
41 lines (28 loc) · 997 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
31
32
33
34
35
36
37
38
39
40
41
# Build Stage
FROM lacion/alpine-golang-buildimage:1.12.4 AS build-stage
LABEL app="build-bantay"
LABEL REPO="https://github.com/KixPanganiban/bantay"
ENV PROJPATH=/go/src/github.com/KixPanganiban/bantay
# Because of https://github.com/docker/docker/issues/14914
ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin
ADD . /go/src/github.com/KixPanganiban/bantay
WORKDIR /go/src/github.com/KixPanganiban/bantay
RUN go get .
RUN make build-alpine
# Final Stage
FROM lacion/alpine-base-image:latest
ARG GIT_COMMIT
ARG VERSION
LABEL REPO="https://github.com/KixPanganiban/bantay"
LABEL GIT_COMMIT=$GIT_COMMIT
LABEL VERSION=$VERSION
# Because of https://github.com/docker/docker/issues/14914
ENV PATH=$PATH:/opt/bantay/bin
WORKDIR /opt/bantay/bin
COPY --from=build-stage /go/src/github.com/KixPanganiban/bantay/bin/bantay /opt/bantay/bin/
RUN chmod +x /opt/bantay/bin/bantay
# Create appuser
RUN adduser -D -g '' bantay
USER bantay
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/opt/bantay/bin/bantay"]