UNCLASSIFIED

Commit 1ae37e72 authored by Jeffrey Weatherford's avatar Jeffrey Weatherford
Browse files

Merge branch 'wingkwan.lau-development-patch-59643' into 'development'

Update Dockerfile

See merge request !22
parents 051d4c82 4650ccd9
Pipeline #441044 passed with stages
in 8 minutes and 47 seconds
...@@ -24,10 +24,8 @@ ENV PROMPT_COMMAND="" ...@@ -24,10 +24,8 @@ ENV PROMPT_COMMAND=""
# Copy extra files to the image. # Copy extra files to the image.
COPY ./scripts /usr/bin COPY ./scripts /usr/bin
RUN chmod a+x /usr/bin/container-entrypoint && \ RUN chmod a+x /usr/bin/fix-permissions && \
chmod a+x /usr/bin/fix-permissions && \
chmod a+x /usr/bin/rpm-file-permissions && \ chmod a+x /usr/bin/rpm-file-permissions && \
chmod a+x /usr/bin/generate-container-user && \
chmod a+x /usr/bin/py-enable chmod a+x /usr/bin/py-enable
# yum Updates # yum Updates
......
#!/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 "$@"
# 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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment