circulartext commited on
Commit
3f0e6c7
·
1 Parent(s): 0c91ad6

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +7 -3
entrypoint.sh CHANGED
@@ -1,11 +1,15 @@
1
  #!/bin/bash
2
  set -e
3
 
4
- # Set the user dynamically during runtime based on an environment variable
5
  if [ -n "$USER_ID" ]; then
6
- adduser --disabled-password --gecos '' --uid $USER_ID user
 
 
 
 
7
  fi
8
 
9
- # Run the CMD
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