forked from myrmex-org/docker-lambda-packager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathal1.entrypoint.sh
More file actions
executable file
·33 lines (29 loc) · 1.26 KB
/
al1.entrypoint.sh
File metadata and controls
executable file
·33 lines (29 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
set -e
if [ `whoami` == "root" ]; then
if [ "$RUNTIME" == "python" ] || [ "$RUNTIME" == "python2" ] || [ "$RUNTIME" == "python2.7" ]; then
echo "Using python v2.7 runtime"
elif [ "$RUNTIME" == "python3" ] || [ "$RUNTIME" == "python3.7" ]; then
echo "Using python v3.7 runtime"
elif [ "$RUNTIME" == "python3.6" ]; then
echo "Using python v3.6 runtime"
ln -sf /opt/python-${PYTHON_VERSION_3_6}/bin/python3 /usr/bin/python3
ln -sf /opt/python-${PYTHON_VERSION_3_6}/bin/pip3 /usr/bin/pip3
elif [ "$RUNTIME" == "node6" ]; then
echo "Using node v6 runtime"
rm /usr/local/bin/node /usr/local/bin/npm
ln -sf /opt/node-v${NODE_VERSION_6}-linux-x64/bin/node /usr/local/bin/node
ln -sf /opt/node-v${NODE_VERSION_6}-linux-x64/bin/npm /usr/local/bin/npm
else
echo "Using node v8 runtime"
fi
if [ "$HOST_UID" != "" ]; then
# If the user is root and a HOST_UID environment variable exists,
# we change the myrmex user UID and execute the command as the myrmex user
if [ "$HOST_UID" != `id -u $DEFAULT_USER` ]; then
echo "Changing $DEFAULT_USER UID to $HOST_UID"
change-uid $HOST_UID $HOST_GID >/dev/null
fi
fi
fi
exec $@