browser-asmjs: cp ~/.emscripten, etc to the user home in the entrypoint

This commit is contained in:
Matt McCormick 2016-07-06 15:33:35 -04:00
parent b84b303f13
commit 30e29f3bbb
3 changed files with 12 additions and 5 deletions

View File

@ -8,7 +8,9 @@ darwin-x64:
$(DOCKER) build -t $(IMAGE)-darwin-x64 darwin-x64 $(DOCKER) build -t $(IMAGE)-darwin-x64 darwin-x64
browser-asmjs: base browser-asmjs/Dockerfile browser-asmjs: base browser-asmjs/Dockerfile
cp -r test browser-asmjs/
$(DOCKER) build -t $(IMAGE)-browser-asmjs browser-asmjs $(DOCKER) build -t $(IMAGE)-browser-asmjs browser-asmjs
rm -rf browser-asmjs/test
linux-x86: linux-x86:
$(DOCKER) build -t $(IMAGE)-linux-x86 linux-x86 $(DOCKER) build -t $(IMAGE)-linux-x86 linux-x86

View File

@ -28,13 +28,17 @@ ENV CC=/usr/emsdk_portable/emscripten/tag-${EMSCRIPTEN_VERSION}/emcc \
AR=/usr/emsdk_portable/emscripten/tag-${EMSCRIPTEN_VERSION}/emar AR=/usr/emsdk_portable/emscripten/tag-${EMSCRIPTEN_VERSION}/emar
# Emscripten generates system libraries the firsts time it runs # Emscripten generates system libraries the firsts time it runs
ADD test/ /tmp/test/
RUN cd /tmp && \ RUN cd /tmp && \
/bin/echo -e "#include <iostream>\nint main() { std::cout << \"first run\"; return 0; }" > /tmp/first_run.cxx && \ /bin/echo -e "#include <iostream>\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.* && \ rm /tmp/first_run.* && \
/bin/echo -e "#include <stdio.h>\nint main() { printf(\"first run\"); return 0; }" > /tmp/first_run.c && \ /bin/echo -e "#include <stdio.h>\nint main() { printf(\"first run\"); return 0; }" > /tmp/first_run.c && \
$CC /tmp/first_run.c && \ $CC /tmp/first_run.c -o a.out.js && \
rm /tmp/first_run.* 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 ENV DEFAULT_DOCKCROSS_IMAGE thewtex/cross-compiler-browser-asmjs

View File

@ -26,8 +26,9 @@ if [[ -n $BUILDER_UID ]] && [[ -n $BUILDER_GID ]]; then
groupadd -o -g $BUILDER_GID $BUILDER_GROUP 2> /dev/null groupadd -o -g $BUILDER_GID $BUILDER_GROUP 2> /dev/null
useradd -o -m -g $BUILDER_GID -u $BUILDER_UID $BUILDER_USER 2> /dev/null useradd -o -m -g $BUILDER_GID -u $BUILDER_UID $BUILDER_USER 2> /dev/null
export HOME=/home/${BUILDER_USER} export HOME=/home/${BUILDER_USER}
cp /root/.bashrc $HOME shopt -s dotglob
chown $BUILDER_UID:$BUILDER_GID $HOME/.bashrc cp -r /root/* $HOME/
chown -R $BUILDER_UID:$BUILDER_GID $HOME/*
# Run the command as the specified user/group. # Run the command as the specified user/group.
exec chpst -u :$BUILDER_UID:$BUILDER_GID "$@" exec chpst -u :$BUILDER_UID:$BUILDER_GID "$@"