From 30e29f3bbb417c47f95c62b4ce6ee7d312f396c9 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 6 Jul 2016 15:33:35 -0400 Subject: [PATCH] browser-asmjs: cp ~/.emscripten, etc to the user home in the entrypoint --- Makefile | 2 ++ browser-asmjs/Dockerfile | 10 +++++++--- imagefiles/entrypoint.sh | 5 +++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index d0722b6..efb6a35 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,9 @@ darwin-x64: $(DOCKER) build -t $(IMAGE)-darwin-x64 darwin-x64 browser-asmjs: base browser-asmjs/Dockerfile + cp -r test browser-asmjs/ $(DOCKER) build -t $(IMAGE)-browser-asmjs browser-asmjs + rm -rf browser-asmjs/test linux-x86: $(DOCKER) build -t $(IMAGE)-linux-x86 linux-x86 diff --git a/browser-asmjs/Dockerfile b/browser-asmjs/Dockerfile index 57c9340..2f2a8bc 100644 --- a/browser-asmjs/Dockerfile +++ b/browser-asmjs/Dockerfile @@ -28,13 +28,17 @@ ENV CC=/usr/emsdk_portable/emscripten/tag-${EMSCRIPTEN_VERSION}/emcc \ AR=/usr/emsdk_portable/emscripten/tag-${EMSCRIPTEN_VERSION}/emar # Emscripten generates system libraries the firsts time it runs +ADD test/ /tmp/test/ RUN cd /tmp && \ /bin/echo -e "#include \nint main() { std::cout << \"first run\"; return 0; }" > /tmp/first_run.cxx && \ - $CXX /tmp/first_run.cxx && \ + $CXX /tmp/first_run.cxx -o a.out.js && \ rm /tmp/first_run.* && \ /bin/echo -e "#include \nint main() { printf(\"first run\"); return 0; }" > /tmp/first_run.c && \ - $CC /tmp/first_run.c && \ - rm /tmp/first_run.* a.out.js + $CC /tmp/first_run.c -o a.out.js && \ + rm /tmp/first_run.* a.out.js && \ + cd /tmp/test && \ + python /tmp/test/run.py; python /tmp/test/run.py && \ + cd && rm -rf /tmp/test ENV DEFAULT_DOCKCROSS_IMAGE thewtex/cross-compiler-browser-asmjs diff --git a/imagefiles/entrypoint.sh b/imagefiles/entrypoint.sh index 81dc827..472867c 100755 --- a/imagefiles/entrypoint.sh +++ b/imagefiles/entrypoint.sh @@ -26,8 +26,9 @@ if [[ -n $BUILDER_UID ]] && [[ -n $BUILDER_GID ]]; then groupadd -o -g $BUILDER_GID $BUILDER_GROUP 2> /dev/null useradd -o -m -g $BUILDER_GID -u $BUILDER_UID $BUILDER_USER 2> /dev/null export HOME=/home/${BUILDER_USER} - cp /root/.bashrc $HOME - chown $BUILDER_UID:$BUILDER_GID $HOME/.bashrc + shopt -s dotglob + cp -r /root/* $HOME/ + chown -R $BUILDER_UID:$BUILDER_GID $HOME/* # Run the command as the specified user/group. exec chpst -u :$BUILDER_UID:$BUILDER_GID "$@"