From f01db221a14d6e68f9a085d1331910be9db5c74f Mon Sep 17 00:00:00 2001 From: Kylian Serrania Date: Thu, 15 Jun 2023 15:35:59 +0200 Subject: [PATCH 1/2] Re-add entrypoint for local usage of images --- deb-arm/Dockerfile | 6 ++++++ deb-x64/Dockerfile | 6 ++++++ entrypoint.sh | 16 ---------------- rpm-arm64/Dockerfile | 6 ++++++ rpm-armhf/Dockerfile | 6 ++++++ rpm-x64/Dockerfile | 6 ++++++ suse-x64/Dockerfile | 6 ++++++ 7 files changed, 36 insertions(+), 16 deletions(-) diff --git a/deb-arm/Dockerfile b/deb-arm/Dockerfile index d151e74c..801fc1aa 100644 --- a/deb-arm/Dockerfile +++ b/deb-arm/Dockerfile @@ -122,3 +122,9 @@ RUN if [ "$DD_TARGET_ARCH" = "aarch64" ] ; then set -ex \ # Force umask to 0022 RUN echo "umask 0022" >> /root/.bashrc + +# Entrypoint - only for local usage, Kubernetes-based Gitlab runners overwrite this +COPY ./entrypoint.sh / +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/deb-x64/Dockerfile b/deb-x64/Dockerfile index bb52044e..dad9419d 100644 --- a/deb-x64/Dockerfile +++ b/deb-x64/Dockerfile @@ -196,3 +196,9 @@ RUN mkdir -p /go/src/github.com/DataDog/datadog-agent # Force umask to 0022 RUN echo "umask 0022" >> /root/.bashrc + +# Entrypoint - only for local usage, Kubernetes-based Gitlab runners overwrite this +COPY ./entrypoint.sh / +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 1095cbfd..cfc9cd37 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,20 +3,4 @@ set -e source /root/.bashrc -if command -v conda; then - # Only try to use conda if it's installed. - # On ARM32 images, we use the system Python 3 because conda is not supported. - conda activate ddpy3 -fi - -if [ "$DD_TARGET_ARCH" = "aarch64" ] ; then - export GIMME_ARCH=arm64 -elif [ "$DD_TARGET_ARCH" = "armhf" ] ; then - export GIMME_ARCH=arm -fi - -if [ -n "$GIMME_GO_VERSION" ] ; then - eval "$(gimme)" -fi - exec "$@" diff --git a/rpm-arm64/Dockerfile b/rpm-arm64/Dockerfile index d5f43188..36c81e16 100644 --- a/rpm-arm64/Dockerfile +++ b/rpm-arm64/Dockerfile @@ -115,3 +115,9 @@ RUN chmod +x /build-gcc.sh \ # Force umask to 0022 RUN echo "umask 0022" >> /root/.bashrc + +# Entrypoint - only for local usage, Kubernetes-based Gitlab runners overwrite this +COPY ./entrypoint.sh / +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/rpm-armhf/Dockerfile b/rpm-armhf/Dockerfile index b36bb8d2..a2d01c93 100644 --- a/rpm-armhf/Dockerfile +++ b/rpm-armhf/Dockerfile @@ -99,3 +99,9 @@ ENV PATH="${GOPATH}/bin:${PATH}" # Force umask to 0022 RUN echo "umask 0022" >> /root/.bashrc + +# Entrypoint - only for local usage, Kubernetes-based Gitlab runners overwrite this +COPY ./entrypoint.sh / +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/rpm-x64/Dockerfile b/rpm-x64/Dockerfile index 6a8b2306..428b98ec 100644 --- a/rpm-x64/Dockerfile +++ b/rpm-x64/Dockerfile @@ -276,3 +276,9 @@ RUN chmod +x /build-gcc.sh \ # Force umask to 0022 RUN echo "umask 0022" >> /root/.bashrc + +# Entrypoint - only for local usage, Kubernetes-based Gitlab runners overwrite this +COPY ./entrypoint.sh / +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/suse-x64/Dockerfile b/suse-x64/Dockerfile index 1fecebda..6aa5a3d8 100644 --- a/suse-x64/Dockerfile +++ b/suse-x64/Dockerfile @@ -175,3 +175,9 @@ RUN mkdir -p /usr/local/var/lib/rpm \ # Force umask to 0022 RUN echo "umask 0022" >> /root/.bashrc + +# Entrypoint - only for local usage, Kubernetes-based Gitlab runners overwrite this +COPY ./entrypoint.sh / +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] From 7f0e231bd754656f35f7cf7b3faa9c33770b5e15 Mon Sep 17 00:00:00 2001 From: Kylian Serrania Date: Fri, 23 Jun 2023 13:23:34 +0200 Subject: [PATCH 2/2] Remove -l in entrypoint --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index cfc9cd37..3f7f38b4 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash -l +#!/bin/bash set -e source /root/.bashrc