From 86c85825ee62a7f38385d12b15f6720ebce78297 Mon Sep 17 00:00:00 2001 From: Mike Bonnet Date: Fri, 1 Nov 2019 11:59:57 -0700 Subject: [PATCH 1/2] 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. --- Vagrantfile | 2 +- docker/Dockerfile-tests-py3 | 2 +- openshift/backend/Dockerfile | 7 ++---- openshift/frontend/Dockerfile | 8 +++--- openshift/frontend/run | 14 +++++++++++ openshift/frontend/run-httpd | 25 ------------------- .../koji/containers/jenkins-slave/Dockerfile | 8 +++--- .../koji/pipelines/jobs/mbs-postmerge.env | 2 +- .../koji/pipelines/jobs/mbs-premerge.env | 2 +- 9 files changed, 29 insertions(+), 41 deletions(-) create mode 100755 openshift/frontend/run delete mode 100755 openshift/frontend/run-httpd diff --git a/Vagrantfile b/Vagrantfile index 07c24a51..fe005fb3 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 184684a7..00000000 --- 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 < Date: Fri, 1 Nov 2019 15:44:38 -0700 Subject: [PATCH 2/2] use the C locale for generating the date string for the specfile changelog This produces exactly the same output as the en_US locale, and is guaranteed to be supported in all environments. --- module_build_service/builder/KojiModuleBuilder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module_build_service/builder/KojiModuleBuilder.py b/module_build_service/builder/KojiModuleBuilder.py index 0618cad4..080ea5a5 100644 --- a/module_build_service/builder/KojiModuleBuilder.py +++ b/module_build_service/builder/KojiModuleBuilder.py @@ -302,7 +302,7 @@ class KojiModuleBuilder(GenericBuilder): name = "module-build-macros" version = "0.1" release = "1" - with set_locale(locale.LC_TIME, "en_US.utf8"): + with set_locale(locale.LC_TIME, "C"): today = datetime.date.today().strftime("%a %b %d %Y") mmd = module_build.mmd()