From 6218c13ad22a6c9cf67f233a566ef62bd46a879d Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Mon, 27 Nov 2017 09:13:24 +0200 Subject: [PATCH] Use the runas entrypoint downloaded from my blog. --- .dockerignore | 10 +--------- Dockerfile | 11 ++++++----- README.md | 2 +- entrypoint | 5 ----- example/README.md | 4 ++-- 5 files changed, 10 insertions(+), 22 deletions(-) delete mode 100755 entrypoint diff --git a/.dockerignore b/.dockerignore index f4681be..72e8ffc 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,9 +1 @@ -.git/ -.gitignore -.dockerignore -*.md -*.dot -*.pdf -example/ -*.swp -Dockerfile +* diff --git a/Dockerfile b/Dockerfile index c57579b..206eea3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,8 +21,9 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ texlive-luatex \ texlive-publishers && \ rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* /var/cache/apt/archives/* -VOLUME /project -WORKDIR /project -COPY entrypoint /entrypoint -ENTRYPOINT ["/entrypoint"] -CMD ["on-change", ".", "make"] +ADD [ "https://www.shore.co.il/blog/static/runas", "/entrypoint" ] +ENTRYPOINT [ "/bin/sh", "/entrypoint" ] +VOLUME /volume +WORKDIR /volume +ENV HOME /volume +CMD [ "on-change", ".", "make" ] diff --git a/README.md b/README.md index 314e675..26c6b5c 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Markdown or DOT). `docker run -itv "$PWD:/project" adarnimrod/presentation` Will watch the current directory and run `make` whenever a file changes. One can -add a shell alias `alias presentation='docker run -itv "$PWD:/project" +add a shell alias `alias presentation='docker run -itv "$PWD:/volume" adarnimrod/presentation'` for easier use. See the example folder for more details. diff --git a/entrypoint b/entrypoint deleted file mode 100755 index 167520c..0000000 --- a/entrypoint +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -set -eu -uid="$(stat . --format '%u')" -gid="$(stat . --format '%g')" -sudo -Eu "#$uid" -g "#$gid" -- "$@" diff --git a/example/README.md b/example/README.md index 405b8c7..d12edad 100644 --- a/example/README.md +++ b/example/README.md @@ -7,8 +7,8 @@ An example presentation written in Markdown and DOT. To watch the current directory and build the presentation whenever a change occurs -`docker run -tv "$PWD:/project" adarnimrod/presentation` +`docker run -tv "$PWD:/volume" adarnimrod/presentation` To build the presentation and exit -`docker run -tv "$PWD:/project" adarnimrod/presentation make` +`docker run -tv "$PWD:/volume" adarnimrod/presentation make` -- GitLab