We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0651b09 commit 85cc98dCopy full SHA for 85cc98d
entrypoint.sh
@@ -1,5 +1,18 @@
1
#!/bin/bash
2
3
+# add a /etc/passwd entry for the current
4
+# arbitrary UID generated randomly by OpenShift at runtime
5
+# (or added by -u switch to docker run)
6
+# (source: container-rhel-examples/starter-arbitrary-uid)
7
+# note that root is required to execute this script (e.g. at entrypoint)
8
+
9
+# if ! whoami &> /dev/null; then
10
+ if [ -w /etc/passwd ]; then
11
+ # append a new entry for the user, using the current arbitrary UID
12
+ echo "${USER_NAME}:x:$(id -u):${MY_GID}:${USER_NAME} user:${HOME}:" >> /etc/passwd
13
+ fi
14
+# fi
15
16
# # create the sock dir properly
17
# # caution: this would require root,
18
# # so cannot be run at entrypoint in user mode
0 commit comments