mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-03 05:03:43 +08:00
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.
15 lines
490 B
Bash
Executable File
15 lines
490 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# OpenShift containers run as a user with a random uid. That uid does not appear
|
|
# in /etc/passwd, causing any attempts to look up the username associated with
|
|
# that uid to fail. This script appends an entry to /etc/passwd for the
|
|
# "default" user, using the current uid and gid.
|
|
|
|
if ! whoami &> /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 "$@"
|