forked from esnet/gdg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (33 loc) · 1.42 KB
/
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
42
43
44
45
46
# Build Stage
FROM golang:1.16.0 AS build-stage
LABEL app="build-grafana-dashboard-manager"
LABEL REPO="https://github.com/netsage-project/grafana-dashboard-manager"
ENV PROJPATH=/go/src/github.com/netsage-project/grafana-dashboard-manager
# Because of https://github.com/docker/docker/issues/14914
ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin
ADD . /go/src/github.com/netsage-project/grafana-dashboard-manager
WORKDIR /go/src/github.com/netsage-project/grafana-dashboard-manager
RUN make build-alpine
# Final Stage
FROM golang:1.16.0
ARG GIT_COMMIT
ARG VERSION
LABEL REPO="https://github.com/netsage-project/grafana-dashboard-manager"
LABEL GIT_COMMIT=$GIT_COMMIT
LABEL VERSION=$VERSION
# Because of https://github.com/docker/docker/issues/14914
ENV PATH=$PATH:/opt/grafana-dashboard-manager/bin
WORKDIR /opt/grafana-dashboard-manager/bin
COPY --from=build-stage /go/src/github.com/netsage-project/grafana-dashboard-manager/bin/grafana-dashboard-manager /opt/grafana-dashboard-manager/bin/
RUN \
apt-get update && \
apt install -y dumb-init && \
apt-get clean autoclean && \
apt-get autoremove --yes && \
rm -rf /var/lib/{apt,dpkg,cache,log}/ && \
chmod +x /opt/grafana-dashboard-manager/bin/grafana-dashboard-manager
# Create appuser
RUN useradd -m grafana-dashboard-manager
USER grafana-dashboard-manager
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/opt/grafana-dashboard-manager/bin/grafana-dashboard-manager"]