I would like run a container with an unknown user (by --user UID) but i need to create this user at runtime
FROM alpine:latest RUN /bin/echo 'root:root' | chpasswd COPY ./entrypoint.sh / ENTRYPOINT [ "/bin/sh", "/entrypoint.sh" ]
#!/bin/sh su - root -c "adduser -u $(id -u) unknown" exec "$@"
But the binary “su” gives me the error:
su : Cannot determine your user name.
Do you have any idea so that I can counter this error please?