Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use /bin/bash instead of /sbin/nologin as default shell for default user as s2i-core did #194

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions 2.4-micro/Dockerfile.c8s
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ COPY 2.4-micro/core-scripts/usr /usr
WORKDIR ${HOME}

# Add default user and prepare httpd
RUN useradd -u 1001 -r -g 0 -d ${HOME} -s /sbin/nologin \
-c "Default Application User" default && \
RUN useradd -u 1001 -r -g 0 -d ${HOME} -c "Default Application User" default && \
chown -R 1001:0 ${APP_ROOT} && \
httpd -v | grep -qe "Apache/$HTTPD_VERSION" && echo "Found VERSION $HTTPD_VERSION" && \
/usr/libexec/httpd-prepare
Expand Down
3 changes: 1 addition & 2 deletions 2.4-micro/Dockerfile.c9s
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ COPY 2.4-micro/core-scripts/usr /usr
WORKDIR ${HOME}

# Add default user and prepare httpd
RUN useradd -u 1001 -r -g 0 -d ${HOME} -s /sbin/nologin \
-c "Default Application User" default && \
RUN useradd -u 1001 -r -g 0 -d ${HOME} -c "Default Application User" default && \
chown -R 1001:0 ${APP_ROOT} && \
httpd -v | grep -qe "Apache/$HTTPD_VERSION" && echo "Found VERSION $HTTPD_VERSION" && \
/usr/libexec/httpd-prepare
Expand Down
3 changes: 1 addition & 2 deletions 2.4-micro/Dockerfile.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ COPY 2.4-micro/core-scripts/usr /usr
WORKDIR ${HOME}

# Add default user and prepare httpd
RUN useradd -u 1001 -r -g 0 -d ${HOME} -s /sbin/nologin \
-c "Default Application User" default && \
RUN useradd -u 1001 -r -g 0 -d ${HOME} -c "Default Application User" default && \
chown -R 1001:0 ${APP_ROOT} && \
httpd -v | grep -qe "Apache/$HTTPD_VERSION" && echo "Found VERSION $HTTPD_VERSION" && \
/usr/libexec/httpd-prepare
Expand Down
2 changes: 1 addition & 1 deletion 2.4-micro/root/usr/share/container-scripts/httpd/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ generate_container_user() {
export USER_ID=$(id -u)
export GROUP_ID=$(id -g)
cp ${HTTPD_CONTAINER_SCRIPTS_PATH}/passwd.template ${passwd_output_dir}/passwd
echo "default:x:${USER_ID}:${GROUP_ID}:Default Application User:${HOME}:/sbin/nologin" >> ${passwd_output_dir}/passwd
echo "default:x:${USER_ID}:${GROUP_ID}:Default Application User:${HOME}:/bin/bash" >> ${passwd_output_dir}/passwd
export LD_PRELOAD=libnss_wrapper.so
export NSS_WRAPPER_PASSWD=${passwd_output_dir}/passwd
export NSS_WRAPPER_GROUP=/etc/group
Expand Down
2 changes: 1 addition & 1 deletion 2.4/root/usr/share/container-scripts/httpd/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ generate_container_user() {
export USER_ID=$(id -u)
export GROUP_ID=$(id -g)
cp ${HTTPD_CONTAINER_SCRIPTS_PATH}/passwd.template ${passwd_output_dir}/passwd
echo "default:x:${USER_ID}:${GROUP_ID}:Default Application User:${HOME}:/sbin/nologin" >> ${passwd_output_dir}/passwd
echo "default:x:${USER_ID}:${GROUP_ID}:Default Application User:${HOME}:/bin/bash" >> ${passwd_output_dir}/passwd
export LD_PRELOAD=libnss_wrapper.so
export NSS_WRAPPER_PASSWD=${passwd_output_dir}/passwd
export NSS_WRAPPER_GROUP=/etc/group
Expand Down