forked from thoth-station/tensorflow-build-s2i
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint
24 lines (21 loc) · 860 Bytes
/
entrypoint
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
echo "ENTRYPOINT...."
# 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:/home/$NB_USER:/bin/false" >> /etc/passwd
else
echo "Container ENTRYPOINT failed to add passwd entry for anonymous UID"
fi
fi
echo 'PS1="\u@\h:\w\\$ \[$(tput sgr0)\]"' >> ~/.bashrc
echo 'alias ll="ls -l"' >> ~/.bashrc
# The git_ssh_command helps the server by pass the Host key checking while connecting to github.
export GIT_SSH_COMMAND='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
# Execute the container CMD under tini for better hygiene
echo "tini...."
tini -s -- "$@"