diff options
Diffstat (limited to '')
-rw-r--r-- | packaging/docker/Dockerfile | 14 | ||||
-rw-r--r-- | packaging/docker/README.md | 3 | ||||
-rwxr-xr-x | packaging/docker/run.sh | 17 |
3 files changed, 31 insertions, 3 deletions
diff --git a/packaging/docker/Dockerfile b/packaging/docker/Dockerfile index d91d1a773..d99d393ae 100644 --- a/packaging/docker/Dockerfile +++ b/packaging/docker/Dockerfile @@ -25,7 +25,8 @@ WORKDIR /opt/netdata.git # Install from source RUN chmod +x netdata-installer.sh && \ cp -rp /deps/* /usr/local/ && \ - ./netdata-installer.sh --dont-wait --dont-start-it ${EXTRA_INSTALL_OPTS} \ + /bin/echo -e "INSTALL_TYPE='oci'\nPREBUILT_ARCH='$(uname -m)'" > ./system/.install-type && \ + ./netdata-installer.sh --dont-wait --dont-start-it --use-system-protobuf ${EXTRA_INSTALL_OPTS} \ "$([ "$RELEASE_CHANNEL" = stable ] && echo --stable-channel)" # files to one directory @@ -56,6 +57,9 @@ RUN mkdir -p /app/usr/sbin/ \ # hadolint ignore=DL3007 FROM netdata/base:latest as base +ARG OFFICIAL_IMAGE=false +ENV NETDATA_OFFICIAL_IMAGE=$OFFICIAL_IMAGE + # Configure system ARG NETDATA_UID=201 ARG NETDATA_GID=201 @@ -98,8 +102,10 @@ RUN chown -R root:root \ chmod 0755 /usr/libexec/netdata/plugins.d/*.plugin && \ chmod 4755 \ /usr/libexec/netdata/plugins.d/cgroup-network \ - /usr/libexec/netdata/plugins.d/apps.plugin \ - /usr/libexec/netdata/plugins.d/freeipmi.plugin && \ + /usr/libexec/netdata/plugins.d/apps.plugin && \ + if [ -f /usr/libexec/netdata/plugins.d/freeipmi.plugin ]; then \ + chmod 4755 /usr/libexec/netdata/plugins.d/freeipmi.plugin; \ + fi && \ # Group write permissions due to: https://github.com/netdata/netdata/pull/6543 find /var/lib/netdata /var/cache/netdata -type d -exec chmod 0770 {} \; && \ find /var/lib/netdata /var/cache/netdata -type f -exec chmod 0660 {} \; && \ @@ -112,3 +118,5 @@ EXPOSE $NETDATA_LISTENER_PORT ENTRYPOINT ["/usr/sbin/run.sh"] HEALTHCHECK --interval=60s --timeout=10s --retries=3 CMD /usr/sbin/health.sh + +ONBUILD ENV NETDATA_OFFICIAL_IMAGE=false diff --git a/packaging/docker/README.md b/packaging/docker/README.md index ed136cfa9..0a4804ae9 100644 --- a/packaging/docker/README.md +++ b/packaging/docker/README.md @@ -32,6 +32,9 @@ directive, not a COMMAND directive. Please adapt your execution scripts accordin ENTRYPOINT vs COMMAND in the [Docker documentation](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). +Our POWER8+ Docker images do not support our FreeIPMI collector. This is a technical limitation in FreeIPMI itself, +and unfortunately not something we can realistically work around. + ## Create a new Netdata Agent container You can create a new Agent container using either `docker run` or Docker Compose. After using either method, you can diff --git a/packaging/docker/run.sh b/packaging/docker/run.sh index c04be9ff8..3f05a1708 100755 --- a/packaging/docker/run.sh +++ b/packaging/docker/run.sh @@ -13,6 +13,23 @@ if [ ! "${DO_NOT_TRACK:-0}" -eq 0 ] || [ -n "$DO_NOT_TRACK" ]; then touch /etc/netdata/.opt-out-from-anonymous-statistics fi + +BALENA_PGID=$(ls -nd /var/run/balena.sock | awk '{print $4}') +DOCKER_PGID=$(ls -nd /var/run/docker.sock | awk '{print $4}') + +re='^[0-9]+$' +if [[ $BALENA_PGID =~ $re ]]; then + echo "Netdata detected balena-engine.sock" + DOCKER_HOST='/var/run/balena-engine.sock' + PGID="$BALENA_PGID" +elif [[ $DOCKER_PGID =~ $re ]]; then + echo "Netdata detected docker.sock" + DOCKER_HOST="/var/run/docker.sock" + PGID=$(ls -nd /var/run/docker.sock | awk '{print $4}') +fi +export PGID +export DOCKER_HOST + if [ -n "${PGID}" ]; then echo "Creating docker group ${PGID}" addgroup -g "${PGID}" "docker" || echo >&2 "Could not add group docker with ID ${PGID}, its already there probably" |