#!/bin/bash set -e # Check if USER_ID environment variable is set if [ -n "$USER_ID" ]; then # Create user with specific UID and disabled password adduser --disabled-password --gecos "" --uid "$USER_ID" user # Switch to the newly created user su -l user fi # Execute the command provided to the container as arguments exec "$@"