@cryptotaxi247 / netdata-1 / commits / 1e9e51119

add more layers to container image (#4722)

Paweł Krupa committed Nov 23, 2018 at 10:59 UTC 1e9e5111934416b78c15443b376a1580b5c02f91
1 file changed +12 -10
docker/Dockerfile
+12 -10
@@ -58,6 +58,10 @@ RUN mkdir -p /app/usr/sbin/ \
58 ARG ARCH
59 FROM multiarch/alpine:${ARCH}
60
61 +# Configure system
62 +ARG NETDATA_UID=201
63 +ARG NETDATA_GID=201
64 +
65 # Reinstall some prerequisites
66 RUN apk --no-cache add curl \
67 fping \
@@ -71,21 +75,19 @@ RUN apk --no-cache add curl \
75 py-yaml \
76 python
77
74 -# Copy files over
75 -COPY --from=builder /app /
76 -
77 -# Configure system
78 -ARG NETDATA_UID=201
79 -ARG NETDATA_GID=201
80 -RUN \
81 - # fping from alpine apk is on a different location. Moving it.
82 - mv /usr/sbin/fping /usr/local/bin/fping && \
78 +# fping from alpine apk is on a different location. Moving it.
79 +RUN mv /usr/sbin/fping /usr/local/bin/fping && \
80 chmod 4755 /usr/local/bin/fping && \
81 mkdir -p /var/log/netdata && \
82 # Add netdata user
83 addgroup -g ${NETDATA_GID} -S netdata && \
84 adduser -S -H -s /usr/sbin/nologin -u ${NETDATA_GID} -h /etc/netdata -G netdata netdata && \
88 - # Apply the permissions as described in
85 +
86 +# Copy files over
87 +COPY --from=builder /app /
88 +
89 +RUN \
90 + # Apply permissions as described in
91 # https://github.com/netdata/netdata/tree/master/doc/netdata-security.md#netdata-directories
92 chown -R root:netdata /etc/netdata && \
93 chown -R netdata:netdata /var/cache/netdata /var/lib/netdata /usr/share/netdata && \