Fix nss_wrapper configuration

Signed-off-by: juan131 <juan.ariza.1311993@gmail.com>
This commit is contained in:
juan131
2022-05-11 15:24:10 +00:00
committed by Bitnami Containers
parent 84ba5c7ec0
commit 696b129146
4 changed files with 19 additions and 14 deletions
+1 -4
View File
@@ -19,13 +19,10 @@ RUN apt-get update && apt-get upgrade -y && \
RUN chmod g+rwX /opt/bitnami
COPY rootfs /
RUN /opt/bitnami/scripts/argo-cd/postunpack.sh
ENV APP_VERSION="2.3.3" \
BITNAMI_APP_NAME="argo-cd" \
LIBNSS_WRAPPER_PATH="/opt/bitnami/common/lib/libnss_wrapper.so" \
LNAME="argocd" \
NSS_WRAPPER_GROUP="/opt/bitnami/argo-cd/nss_group" \
NSS_WRAPPER_PASSWD="/opt/bitnami/argo-cd/nss_passwd" \
PATH="/opt/bitnami/kustomize/bin:/opt/bitnami/ksonnet/bin:/opt/bitnami/helm/bin:/opt/bitnami/common/bin:/opt/bitnami/argo-cd/bin:/opt/bitnami/argo-cd/hack:$PATH"
USER 1001
@@ -0,0 +1 @@
argocd:x:0:
@@ -0,0 +1 @@
argocd:x:1001:0:ArgoCD:/opt/bitnami/argo-cd:/bin/false
@@ -14,17 +14,23 @@ set -o pipefail
print_welcome_page
# Set nss_wrapper vars only when running as non-root
# Configure libnss_wrapper based on the UID/GID used to run the container
# This container supports arbitrary UIDs, therefore we have do it dynamically
if ! am_i_root && ! user_exists "$(id -u)" && [[ -f "$LIBNSS_WRAPPER_PATH" ]]; then
info "Configuring libnss_wrapper"
NSS_WRAPPER_PASSWD="$(mktemp)"
export NSS_WRAPPER_PASSWD
NSS_WRAPPER_GROUP="$(mktemp)"
export NSS_WRAPPER_GROUP
echo "argocd:x:$(id -u):$(id -g):ArgoCD:/opt/bitnami/argo-cd:/bin/false" > "$NSS_WRAPPER_PASSWD"
echo "argocd:x:$(id -g):" > "$NSS_WRAPPER_GROUP"
chmod 400 "$NSS_WRAPPER_PASSWD" "$NSS_WRAPPER_GROUP"
if ! am_i_root; then
export LNAME="argocd"
export LD_PRELOAD="/opt/bitnami/common/lib/libnss_wrapper.so"
if ! user_exists "$(id -u)" && [[ -f "$LD_PRELOAD" ]]; then
info "Configuring libnss_wrapper"
NSS_WRAPPER_PASSWD="$(mktemp)"
export NSS_WRAPPER_PASSWD
NSS_WRAPPER_GROUP="$(mktemp)"
export NSS_WRAPPER_GROUP
echo "argocd:x:$(id -u):$(id -g):ArgoCD:/opt/bitnami/argo-cd:/bin/false" > "$NSS_WRAPPER_PASSWD"
echo "argocd:x:$(id -g):" > "$NSS_WRAPPER_GROUP"
chmod 400 "$NSS_WRAPPER_PASSWD" "$NSS_WRAPPER_GROUP"
fi
fi
exec /opt/bitnami/argo-cd/bin/argocd
echo ""
exec "$@"