From 4650ccd9b41982dd9f98e3bfc790f7af95a0d280 Mon Sep 17 00:00:00 2001 From: WingKwan Lau Date: Fri, 20 Aug 2021 19:30:52 +0000 Subject: [PATCH] Update Dockerfile Deleted scripts/generate-container-user, scripts/container-entrypoint files --- Dockerfile | 4 +--- scripts/container-entrypoint | 9 --------- scripts/generate-container-user | 20 -------------------- 3 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 scripts/container-entrypoint delete mode 100644 scripts/generate-container-user diff --git a/Dockerfile b/Dockerfile index 32e32e1..eb0691e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,10 +24,8 @@ ENV PROMPT_COMMAND="" # Copy extra files to the image. COPY ./scripts /usr/bin -RUN chmod a+x /usr/bin/container-entrypoint && \ - chmod a+x /usr/bin/fix-permissions && \ +RUN chmod a+x /usr/bin/fix-permissions && \ chmod a+x /usr/bin/rpm-file-permissions && \ - chmod a+x /usr/bin/generate-container-user && \ chmod a+x /usr/bin/py-enable # yum Updates diff --git a/scripts/container-entrypoint b/scripts/container-entrypoint deleted file mode 100644 index 339a74c..0000000 --- a/scripts/container-entrypoint +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -# temp: hard coding "hero" as container username (todo: fix to use env vars for username and homedir) -if [ `id -u` -ge 1 ]; then - echo "hero:x:`id -u`:`id -g`:here:/opt/app-root:/bin/bash" >> /etc/passwd -fi - -exec "$@" - diff --git a/scripts/generate-container-user b/scripts/generate-container-user deleted file mode 100644 index f092c51..0000000 --- a/scripts/generate-container-user +++ /dev/null @@ -1,20 +0,0 @@ -# Set current user in nss_wrapper -USER_ID=$(id -u) -GROUP_ID=$(id -g) - -if [ x"$USER_ID" != x"0" -a x"$USER_ID" != x"1001" ]; then - - NSS_WRAPPER_PASSWD=/opt/app-root/etc/passwd - NSS_WRAPPER_GROUP=/etc/group - - cat /etc/passwd | sed -e 's/^default:/builder:/' > $NSS_WRAPPER_PASSWD - - echo "default:x:${USER_ID}:${GROUP_ID}:Default Application User:${HOME}:/sbin/nologin" >> $NSS_WRAPPER_PASSWD - - export NSS_WRAPPER_PASSWD - export NSS_WRAPPER_GROUP - - LD_PRELOAD=libnss_wrapper.so - export LD_PRELOAD -fi - -- GitLab