forked from emscripten-core/emsdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint
executable file
·27 lines (21 loc) · 868 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
25
26
27
#!/bin/sh
# In case when mapped user id by `docker run -u` is not created inside docker image
# The `$HOME` variable points to `/` - which prevents any tool to write to, as it requires root access
# In such case we set `$HOME` to `/tmp` as it should r/w for everyone
if [ "$HOME" = "/" ] ; then
export HOME=/tmp
fi
# In case of running as root, use `umask` to reduce problem of file permission on host
if [ "$(id -g)" = "0" ] && [ "$(id -u)" = "0" ] ;
then
umask 0000
fi
# Export this image specific Environment variables
# Those variables are important to use dedicated folder for all cache and predefined config file
export EM_CONFIG=/emsdk/.emscripten
export EM_CACHE=/emsdk/.data/cache
export EM_PORTS=/emsdk/.data/ports
# Activate Emscripten SDK
. ${EMSDK}/emsdk_set_env.sh
# Evaluate a command that's coming after `docker run` / `docker exec`
"$@"