From 86c85825ee62a7f38385d12b15f6720ebce78297 Mon Sep 17 00:00:00 2001 From: Mike Bonnet Date: Nov 01 2019 19:04:36 +0000 Subject: update container base images to Fedora 31 Also update the uid management in the frontend image to be more consistent with best practices, as demonstrated by: https://github.com/RHsyseng/container-rhel-examples/tree/master/starter-arbitrary-uid This allows the dependency on nss_wrapper to be dropped. --- diff --git a/Vagrantfile b/Vagrantfile index 07c24a5..fe005fb 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -130,7 +130,7 @@ $script_services = < /dev/null; then + if [ -w /etc/passwd ]; then + echo "${USER_NAME:-default}:x:$(id -u):$(id -g):${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd + fi +fi + +exec "$@" diff --git a/openshift/frontend/run-httpd b/openshift/frontend/run-httpd deleted file mode 100755 index 184684a..0000000 --- a/openshift/frontend/run-httpd +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -set -eu - -# OpenShift containers run as a user with a random uid, which does not appear in -# /etc/passwd. httpd tries to look up the uid for the user it is running as -# (default in this case), and will exit if it cannot find that user in -# /etc/passwd. This script copies /etc/passwd to /tmp to make it writable, and -# appends an entry to /etc/passwd for the "default" user, using the current uid -# and gid. It then uses libnss_wrapper.so to redirect references from -# /etc/passwd to our modified file in /tmp, so httpd can run as "default". - -export USER_ID=$(id -u) -export GROUP_ID=$(id -g) - -cp /etc/passwd /tmp/passwd -cat >> /tmp/passwd <