Created
September 20, 2017 16:43
-
-
Save sub-mod/34548d65ecffcdf7783d76983bb7e792 to your computer and use it in GitHub Desktop.
entrypoint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Check whether there is a passwd entry for the container UID | |
| myuid=$(id -u) | |
| mygid=$(id -g) | |
| uidentry=$(getent passwd $myuid) | |
| # If there is no passwd entry for the container UID, attempt to create one | |
| if [ -z "$uidentry" ] ; then | |
| if [ -w /etc/passwd ] ; then | |
| echo "$myuid:x:$myuid:$mygid:anonymous uid:$SPARK_HOME:/bin/false" >> /etc/passwd | |
| else | |
| echo "Container ENTRYPOINT failed to add passwd entry for anonymous UID" | |
| fi | |
| fi | |
| # Execute the container CMD under tini for better hygiene | |
| tini -s -- "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment