Add uid entrypoint
This commit is contained in:
parent
493adbe7cc
commit
31a7934291
@ -5,3 +5,6 @@ COPY watches.yaml ${HOME}/watches.yaml
|
||||
COPY ansible/zuul.yaml ${HOME}/zuul.yaml
|
||||
COPY ansible/group_vars/ ${HOME}/group_vars/
|
||||
COPY ansible/roles/ ${HOME}/roles/
|
||||
|
||||
COPY build/uid_entrypoint.sh /uid_entrypoint
|
||||
ENTRYPOINT [ "/uid_entrypoint" ]
|
||||
|
8
build/uid_entrypoint.sh
Executable file
8
build/uid_entrypoint.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! whoami &> /dev/null; then
|
||||
if [ -w /etc/passwd ]; then
|
||||
echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd
|
||||
fi
|
||||
fi
|
||||
exec "$@"
|
@ -16,6 +16,7 @@ spec:
|
||||
containers:
|
||||
- name: ansible
|
||||
command:
|
||||
- /uid_entrypoint
|
||||
- /usr/local/bin/ao-logs
|
||||
- /tmp/ansible-operator/runner
|
||||
- stdout
|
||||
|
Loading…
Reference in New Issue
Block a user