From 0fc5a001791bd3484b89c68b979325f97841b830 Mon Sep 17 00:00:00 2001 From: Alexandre Vicenzi Date: Tue, 10 Dec 2024 14:23:40 +0100 Subject: [PATCH] Rename gosu The current gosu script is not a replacement for gosu, because of that it is better to rename to a completely new name to avoid confusion and compatibility issues. Fixes #2070 Signed-off-by: Alexandre Vicenzi --- src/bci_build/package/mariadb.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/bci_build/package/mariadb.py b/src/bci_build/package/mariadb.py index 5bc70b468..c5ce490f9 100644 --- a/src/bci_build/package/mariadb.py +++ b/src/bci_build/package/mariadb.py @@ -18,7 +18,7 @@ from bci_build.package.helpers import generate_package_version_check from bci_build.package.versions import get_pkg_version -_MARIADB_GOSU = b"""#!/bin/bash +_MARIADB_IDEXEC = b"""#!/bin/bash u=$1 shift @@ -110,7 +110,7 @@ Path(__file__).parent / "mariadb" / str(mariadb_version) / "LICENSE" ).read_bytes(), "healthcheck.sh": healthcheck, - "gosu": _MARIADB_GOSU, + "idexec": _MARIADB_IDEXEC, "_constraints": generate_disk_size_constraints(11), }, support_level=SupportLevel.L3, @@ -129,8 +129,12 @@ COPY healthcheck.sh /usr/local/bin/ {DOCKERFILE_RUN} chmod 755 /usr/local/bin/healthcheck.sh -COPY gosu /usr/local/bin/gosu -{DOCKERFILE_RUN} chmod 755 /usr/local/bin/gosu +COPY idexec /usr/local/bin/idexec +{DOCKERFILE_RUN} chmod 755 /usr/local/bin/idexec + +# replace gosu calls with idexec +{DOCKERFILE_RUN} sed -i 's/exec gosu /exec idexec /g' /usr/local/bin/{_ENTRYPOINT_FNAME} +{DOCKERFILE_RUN} sed -i 's/exec gosu /exec idexec /g' /usr/local/bin/healthcheck.sh {DOCKERFILE_RUN} sed -i -e 's,$(pwgen .*),$(openssl rand -base64 36),' /usr/local/bin/{_ENTRYPOINT_FNAME}