netdata/packaging: Fix broken netdata docker image for dbengine-enabled code (#6020)
1) Do not double COPY stuff at the second layer, that does not work like that. Install judy on / and move over just like we do with netdata to bring all over with one COPY 2) After you install judy, remove the stuff you bring in to make install command work for judy The image has been tested with the latest fixes from the helper-images side. This change should be merged in AFTER we merge in helper-images fix
Paul Emm. Katsoulakis committed
May 15, 2019 at 17:34 UTC
469150e878ac7ec66e4f3559ef746d67cc638ada
1 file changed
+7
-3
packaging/docker/Dockerfile
+7
-3
@@ -5,7 +5,9 @@
5
# It is automated in `build.sh` script
6
ARG ARCH=amd64
7
# This image contains preinstalled dependecies
8
-FROM netdata/builder:${ARCH} as builder
8
+FROM netdata/builder:${ARCH} as builder
9
+
10
+ENV JUDY_VER 1.0.5
11
12
# Copy source
13
COPY . /opt/netdata.git
@@ -29,6 +31,7 @@ RUN mkdir -p /app/usr/sbin/ \
31
mv /var/lib/netdata /app/var/lib/ && \
32
mv /etc/netdata /app/etc/ && \
33
mv /usr/sbin/netdata /app/usr/sbin/ && \
34
+ mv /judy-${JUDY_VER} /app/judy-${JUDY_VER} && \
35
mv packaging/docker/run.sh /app/usr/sbin/ && \
36
chmod +x /app/usr/sbin/run.sh
37
@@ -51,7 +54,6 @@ RUN if [ "$(uname -m)" == "x86_64" ]; then \
54
# Copy files over
55
RUN mkdir -p /opt/src
56
COPY --from=builder /app /
54
-COPY --from=builder /opt/src /opt/src
57
58
# Configure system
59
ARG NETDATA_UID=201
@@ -59,7 +61,9 @@ ARG NETDATA_GID=201
61
RUN \
62
# provide judy installation to base image
63
apk add make alpine-sdk && \
62
- cd /opt/src/judy-1.0.5 && make install && cd - && \
64
+ cd /judy-${JUDY_VER} && make install && cd / && \
65
+ # Clean the source stuff once judy is installed
66
+ rm -rf /judy-${JUDY_VER} && apk del make alpine-sdk && \
67
# fping from alpine apk is on a different location. Moving it.
68
mv /usr/sbin/fping /usr/local/bin/fping && \
69
chmod 4755 /usr/local/bin/fping && \