Spaces:
Sleeping
Sleeping
Commit ·
3f0e6c7
1
Parent(s): 0c91ad6
Update entrypoint.sh
Browse files- entrypoint.sh +7 -3
entrypoint.sh
CHANGED
|
@@ -1,11 +1,15 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
set -e
|
| 3 |
|
| 4 |
-
#
|
| 5 |
if [ -n "$USER_ID" ]; then
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
fi
|
| 8 |
|
| 9 |
-
#
|
| 10 |
exec "$@"
|
| 11 |
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
set -e
|
| 3 |
|
| 4 |
+
# Check if USER_ID environment variable is set
|
| 5 |
if [ -n "$USER_ID" ]; then
|
| 6 |
+
# Create user with specific UID and disabled password
|
| 7 |
+
adduser --disabled-password --gecos "" --uid "$USER_ID" user
|
| 8 |
+
|
| 9 |
+
# Switch to the newly created user
|
| 10 |
+
su -l user
|
| 11 |
fi
|
| 12 |
|
| 13 |
+
# Execute the command provided to the container as arguments
|
| 14 |
exec "$@"
|
| 15 |
|