summaryrefslogtreecommitdiffstats
path: root/packaging/docker
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-17 09:30:23 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-17 09:30:23 +0000
commit517a443636daa1e8085cb4e5325524a54e8a8fd7 (patch)
tree5352109cc7cd5122274ab0cfc1f887b685f04edf /packaging/docker
parentReleasing debian version 1.42.4-1. (diff)
downloadnetdata-517a443636daa1e8085cb4e5325524a54e8a8fd7.tar.xz
netdata-517a443636daa1e8085cb4e5325524a54e8a8fd7.zip
Merging upstream version 1.43.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/docker')
-rw-r--r--packaging/docker/Dockerfile41
-rw-r--r--packaging/docker/README.md2
-rwxr-xr-xpackaging/docker/run.sh2
3 files changed, 19 insertions, 26 deletions
diff --git a/packaging/docker/Dockerfile b/packaging/docker/Dockerfile
index 3d05d9d2c..ddc4a4f5c 100644
--- a/packaging/docker/Dockerfile
+++ b/packaging/docker/Dockerfile
@@ -3,7 +3,7 @@
# This image contains preinstalled dependencies
# hadolint ignore=DL3007
-FROM netdata/builder:latest as builder
+FROM netdata/builder:v1 as builder
# One of 'nightly' or 'stable'
ARG RELEASE_CHANNEL=nightly
@@ -28,7 +28,7 @@ WORKDIR /opt/netdata.git
RUN chmod +x netdata-installer.sh && \
cp -rp /deps/* /usr/local/ && \
/bin/echo -e "INSTALL_TYPE='oci'\nPREBUILT_ARCH='$(uname -m)'" > ./system/.install-type && \
- CFLAGS="$(packaging/docker/gen-cflags.sh)" LDFLAGS="-Wl,--gc-sections -Wl,-z,stack-size=8388608" ./netdata-installer.sh --dont-wait --dont-start-it --use-system-protobuf \
+ CFLAGS="$(packaging/docker/gen-cflags.sh)" LDFLAGS="-Wl,--gc-sections" ./netdata-installer.sh --dont-wait --dont-start-it --use-system-protobuf \
${EXTRA_INSTALL_OPTS} --one-time-build --enable-lto "$([ "$RELEASE_CHANNEL" = stable ] && echo --stable-channel)"
# files to one directory
@@ -59,33 +59,41 @@ RUN mkdir -p /app/usr/sbin/ \
#####################################################################
# This image contains preinstalled dependencies
# hadolint ignore=DL3007
-FROM netdata/base:latest as base
+FROM netdata/base:v1 as base
+
+LABEL org.opencontainers.image.authors="Netdatabot <bot@netdata.cloud>"
+LABEL org.opencontainers.image.url="https://netdata.cloud"
+LABEL org.opencontainers.image.documentation="https://learn.netdata.cloud"
+LABEL org.opencontainers.image.source="https://github.com/netdata/netdata"
+LABEL org.opencontainers.image.title="Netdata Agent"
+LABEL org.opencontainers.image.description="Official Netdata Agent Docker Image"
+LABEL org.opencontainers.image.vendor="Netdata Inc."
ARG OFFICIAL_IMAGE=false
ENV NETDATA_OFFICIAL_IMAGE=$OFFICIAL_IMAGE
-# Configure system
+ONBUILD ENV NETDATA_OFFICIAL_IMAGE=false
+
ARG NETDATA_UID=201
ARG NETDATA_GID=201
ENV DOCKER_GRP netdata
ENV DOCKER_USR netdata
# If DISABLE_TELEMETRY is set, it will disable anonymous stats collection and reporting
#ENV DISABLE_TELEMETRY=1
+ENV NETDATA_LISTENER_PORT 19999
+EXPOSE $NETDATA_LISTENER_PORT
+
+ENV NETDATA_EXTRA_APK_PACKAGES=""
-# Copy files over
RUN mkdir -p /opt/src /var/log/netdata && \
- # Link log files to stdout
ln -sf /dev/stdout /var/log/netdata/access.log && \
ln -sf /dev/stdout /var/log/netdata/debug.log && \
ln -sf /dev/stderr /var/log/netdata/error.log && \
ln -sf /dev/stdout /var/log/netdata/collector.log && \
ln -sf /dev/stdout /var/log/netdata/health.log && \
- # Add netdata user
addgroup -g ${NETDATA_GID} -S "${DOCKER_GRP}" && \
adduser -S -H -s /usr/sbin/nologin -u ${NETDATA_GID} -h /etc/netdata -G "${DOCKER_GRP}" "${DOCKER_USR}"
- # Fix handling of config directory
-# Long-term this should leverage BuildKit’s mount option.
COPY --from=builder /app /
# Apply the permissions as described in
@@ -119,21 +127,6 @@ RUN chown -R root:root \
find /var/lib/netdata /var/cache/netdata -type f -exec chmod 0660 {} \; && \
cp -va /etc/netdata /etc/netdata.stock
-ENV NETDATA_LISTENER_PORT 19999
-EXPOSE $NETDATA_LISTENER_PORT
-
-ENV NETDATA_EXTRA_APK_PACKAGES=""
-
ENTRYPOINT ["/usr/sbin/run.sh"]
HEALTHCHECK --interval=60s --timeout=10s --retries=3 CMD /usr/sbin/health.sh
-
-ONBUILD ENV NETDATA_OFFICIAL_IMAGE=false
-
-LABEL org.opencontainers.image.authors="Netdatabot <bot@netdata.cloud>"
-LABEL org.opencontainers.image.url="https://netdata.cloud"
-LABEL org.opencontainers.image.documentation="https://learn.netdata.cloud"
-LABEL org.opencontainers.image.source="https://github.com/netdata/netdata"
-LABEL org.opencontainers.image.title="Netdata Agent"
-LABEL org.opencontainers.image.description="Official Netdata Agent Docker Image"
-LABEL org.opencontainers.image.vendor="Netdata Inc."
diff --git a/packaging/docker/README.md b/packaging/docker/README.md
index eb7deb203..b4ce58254 100644
--- a/packaging/docker/README.md
+++ b/packaging/docker/README.md
@@ -187,7 +187,7 @@ services:
security_opt:
- apparmor:unconfined
volumes:
- - ./netdataconfig/netdata:/etc/netdata:ro
+ - ./netdataconfig/netdata:/etc/netdata
- netdatalib:/var/lib/netdata
- netdatacache:/var/cache/netdata
- /etc/passwd:/host/etc/passwd:ro
diff --git a/packaging/docker/run.sh b/packaging/docker/run.sh
index eede14e38..1b6ce7c66 100755
--- a/packaging/docker/run.sh
+++ b/packaging/docker/run.sh
@@ -21,7 +21,7 @@ if [ ! "${DISABLE_TELEMETRY:-0}" -eq 0 ] ||
touch /etc/netdata/.opt-out-from-anonymous-statistics
fi
-chmod o+rX / # Needed to fix permissions issues in some cases.
+chmod o+rX / 2>/dev/null || echo "Unable to change permissions without errors."
BALENA_PGID=$(stat -c %g /var/run/balena.sock 2>/dev/null || true)
DOCKER_PGID=$(stat -c %g /var/run/docker.sock 2>/dev/null || true)