From f59ce2df267661a6b38b2f341cc86c8f1f3f7704 Mon Sep 17 00:00:00 2001 From: Tommi Liittokivi Date: Mon, 7 Aug 2017 09:44:47 +0300 Subject: [PATCH] Workdir change --- Dockerfile | 22 +++++++++++----------- README.md | 5 ++--- script/entrypoint.sh | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 061f7a0..d1f4870 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM node:6.10-alpine -MAINTAINER Conmio developers -RUN apk --no-cache update && \ - apk --no-cache add less bash make curl su-exec - -COPY script/entrypoint.sh /usr/local/bin/entrypoint.sh -RUN chmod 755 /usr/local/bin/entrypoint.sh - -ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] -WORKDIR /home/user - +FROM node:6.10-alpine +MAINTAINER Conmio developers +RUN apk --no-cache update && \ + apk --no-cache add less bash make curl openssl su-exec + +COPY script/entrypoint.sh /usr/local/bin/entrypoint.sh +RUN chmod 755 /usr/local/bin/entrypoint.sh + +WORKDIR /app + +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] diff --git a/README.md b/README.md index b1dca9c..13460f5 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,9 @@ #### Running node.js script: ``` -docker run --rm -it \ +docker run --rm \ -e LOCAL_USER_ID=`id -u $USER`\ - -v ~/my_local_folder:/home/user/project \ - -w /home/user/project \ + -v ~/script_folder:/app \ conmio/node node script.js ``` --- diff --git a/script/entrypoint.sh b/script/entrypoint.sh index 1774d23..ee50914 100644 --- a/script/entrypoint.sh +++ b/script/entrypoint.sh @@ -2,7 +2,6 @@ # Either use the LOCAL_USER_ID if passed in at runtime or fallback USER_ID=${LOCAL_USER_ID:-9001} -echo "Starting with UID : $USER_ID" # if user with given ID already exists, remove it USER_NAME=$(getent passwd "$USER_ID" | cut -d: -f1) @@ -13,6 +12,7 @@ fi # Add local user adduser -D -u $USER_ID user export HOME=/home/user +chown user /app if [ -z $1 ]; then exec su-exec user bash