From 7b042bf94af29c32f64a80fe34e7f97899667aad Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen.haas@lakedrops.com> Date: Sat, 27 Mar 2021 11:40:48 +0100 Subject: [PATCH] Incorporate changes from @jceb's review --- Dockerfile | 5 +++-- bin/docker-entrypoint.sh | 3 ++- bin/mdshow | 4 +++- mdshow | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 577255a..5392d58 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,8 @@ RUN echo "Adding system components" && \ ADD bin/* /usr/local/bin/ -RUN echo "Setup MdShow" && \ - mdshow setup && \ +RUN echo "Setup mdshow" && \ + mdshow setup CONFIG_PATH=/opt && \ ln -s /opt/mdshow/reveal.js/node_modules/gulp/bin/gulp.js /usr/bin/gulp && \ mkdir -p /opt/mdshow/theme && \ chmod -R a+rwx /opt/mdshow && \ @@ -40,5 +40,6 @@ RUN echo "Setup MdShow" && \ rm -rf /root/.npm && \ echo "Completed" +WORKDIR /mdshow ENTRYPOINT ["docker-entrypoint.sh"] CMD ["/bin/bash"] diff --git a/bin/docker-entrypoint.sh b/bin/docker-entrypoint.sh index 9c6fa05..5cfa123 100755 --- a/bin/docker-entrypoint.sh +++ b/bin/docker-entrypoint.sh @@ -1,5 +1,6 @@ -#!/bin/sh +#!/bin/bash set -e +set -u # first arg is `-f` or `--some-option` if [ "${1#-}" != "$1" ]; then diff --git a/bin/mdshow b/bin/mdshow index 23bde43..20dc001 100755 --- a/bin/mdshow +++ b/bin/mdshow @@ -7,7 +7,9 @@ SHELL := /bin/bash -MDSHOW_CONFIG = /opt/mdshow +CONFIG_PATH = ${HOME}/.config +MDSHOW_CONFIG = $(CONFIG_PATH)/mdshow + SLIDES = slides.md BUILD_DIR = .build_$(basename $(SLIDES)) PORT = 3000 diff --git a/mdshow b/mdshow index e4dab78..f9ca99c 100755 --- a/mdshow +++ b/mdshow @@ -4,4 +4,4 @@ if [[ -n $MDSHOW_THEME_PATH ]]; then THEME=--volume=${MDSHOW_THEME_PATH}:/opt/mdshow/theme/$(basename ${MDSHOW_THEME_PATH}) fi -docker run --user=$(id -u) --rm -it --net=host ${THEME} --volume=$(pwd):/mdshow --workdir=/mdshow registry.lakedrops.com/docker/mdshow mdshow $@ +docker run --user=$(id -u) --rm -it --net=host ${THEME} --volume=$(pwd):/mdshow registry.lakedrops.com/docker/mdshow mdshow CONFIG_PATH=/opt $@ -- GitLab