From 0aefc95fe1f159eabfb2e18ebcd4a1376e924438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralf=20D=2E=20M=C3=BCller?= Date: Tue, 19 Mar 2024 09:41:54 +0100 Subject: [PATCH 1/6] seems to be prod ready --- alpine-latest/Dockerfile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/alpine-latest/Dockerfile b/alpine-latest/Dockerfile index 505478e..6be5755 100644 --- a/alpine-latest/Dockerfile +++ b/alpine-latest/Dockerfile @@ -31,27 +31,29 @@ USER dtcuser WORKDIR /home/dtcuser ENV HOME=/home/dtcuser -ENV GRADLE_USER_HOME=/home/dtcuser/.gradle +ENV GRADLE_USER_HOME=/home/dtcuser/.doctoolchain/.gradle ARG DTC_VERSION RUN git clone --branch ng https://github.com/docToolchain/docToolchain.git && \ cd docToolchain && \ git fetch --tags && \ - git checkout ${DTC_VERSION} && \ git submodule update -i && \ # remove .git folders rm -rf `find -type d -name .git` && \ umask g+w && \ - ./gradlew downloadDependencies && \ + ./gradlew downloadDependencies --info && \ chmod -R o=u $GRADLE_USER_HOME && \ chmod -R g=u $GRADLE_USER_HOME && \ rm -r $GRADLE_USER_HOME/daemon && \ chmod -R o=u $HOME -# add reveal.js -RUN cd /home/dtcuser/docToolchain/resources/. && \ - ./clone.sh && \ - cd - +# trying to get the last dependencies + +RUN curl -Lo dtcw https://doctoolchain.org/dtcw && \ + chmod +x dtcw + +RUN ./dtcw install doctoolchain +RUN echo y | ./dtcw local tasks ENV PATH="/home/dtcuser/docToolchain/bin:${PATH}" @@ -61,4 +63,4 @@ WORKDIR /project VOLUME /project -ENTRYPOINT /bin/bash \ No newline at end of file +ENTRYPOINT /bin/bash From d49c4973fe81207ae4497235437b248ffc28d609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralf=20D=2E=20M=C3=BCller?= Date: Tue, 19 Mar 2024 09:47:37 +0100 Subject: [PATCH 2/6] seems to be prod ready --- alpine-latest/Dockerfile | 5 +++++ alpine/Dockerfile | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/alpine-latest/Dockerfile b/alpine-latest/Dockerfile index 6be5755..a35a3b6 100644 --- a/alpine-latest/Dockerfile +++ b/alpine-latest/Dockerfile @@ -47,6 +47,11 @@ RUN git clone --branch ng https://github.com/docToolchain/docToolchain.git rm -r $GRADLE_USER_HOME/daemon && \ chmod -R o=u $HOME +# add reveal.js +RUN cd /home/dtcuser/docToolchain/resources/. && \ + ./clone.sh && \ + cd - \ + # trying to get the last dependencies RUN curl -Lo dtcw https://doctoolchain.org/dtcw && \ diff --git a/alpine/Dockerfile b/alpine/Dockerfile index f5f7365..871b27d 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -31,7 +31,7 @@ USER dtcuser WORKDIR /home/dtcuser ENV HOME=/home/dtcuser -ENV GRADLE_USER_HOME=/home/dtcuser/.gradle +ENV GRADLE_USER_HOME=/home/dtcuser/.doctoolchain/.gradle ARG DTC_VERSION RUN git clone --branch ng https://github.com/docToolchain/docToolchain.git && \ @@ -48,6 +48,18 @@ RUN git clone --branch ng https://github.com/docToolchain/docToolchain.git rm -r $GRADLE_USER_HOME/daemon && \ chmod -R o=u $HOME +# add reveal.js +RUN cd /home/dtcuser/docToolchain/resources/. && \ + ./clone.sh && \ + cd - \ + +# trying to get the last dependencies + +RUN curl -Lo dtcw https://doctoolchain.org/dtcw && \ + chmod +x dtcw + +RUN ./dtcw install doctoolchain +RUN echo y | ./dtcw local tasks ENV PATH="/home/dtcuser/docToolchain/bin:${PATH}" From d701aa39be7c6a3e63f83ba89a8aca590f0d51d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralf=20D=2E=20M=C3=BCller?= Date: Tue, 19 Mar 2024 09:49:19 +0100 Subject: [PATCH 3/6] seems to be prod ready --- alpine-latest/Dockerfile | 2 +- alpine/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/alpine-latest/Dockerfile b/alpine-latest/Dockerfile index a35a3b6..1a1ef81 100644 --- a/alpine-latest/Dockerfile +++ b/alpine-latest/Dockerfile @@ -50,7 +50,7 @@ RUN git clone --branch ng https://github.com/docToolchain/docToolchain.git # add reveal.js RUN cd /home/dtcuser/docToolchain/resources/. && \ ./clone.sh && \ - cd - \ + cd - # trying to get the last dependencies diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 871b27d..37163a0 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -51,7 +51,7 @@ RUN git clone --branch ng https://github.com/docToolchain/docToolchain.git # add reveal.js RUN cd /home/dtcuser/docToolchain/resources/. && \ ./clone.sh && \ - cd - \ + cd - # trying to get the last dependencies From ce78b0769d9d336fe8f287b5a515a738bbc27050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralf=20D=2E=20M=C3=BCller?= Date: Tue, 19 Mar 2024 10:03:18 +0100 Subject: [PATCH 4/6] seems to be prod ready --- alpine-latest/Dockerfile | 7 +------ alpine/Dockerfile | 5 ----- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/alpine-latest/Dockerfile b/alpine-latest/Dockerfile index 1a1ef81..7af98d6 100644 --- a/alpine-latest/Dockerfile +++ b/alpine-latest/Dockerfile @@ -34,7 +34,7 @@ ENV HOME=/home/dtcuser ENV GRADLE_USER_HOME=/home/dtcuser/.doctoolchain/.gradle ARG DTC_VERSION -RUN git clone --branch ng https://github.com/docToolchain/docToolchain.git && \ +RUN git clone --branch ng https://github.com/docToolchain/docToolchain.git && \ cd docToolchain && \ git fetch --tags && \ git submodule update -i && \ @@ -47,11 +47,6 @@ RUN git clone --branch ng https://github.com/docToolchain/docToolchain.git rm -r $GRADLE_USER_HOME/daemon && \ chmod -R o=u $HOME -# add reveal.js -RUN cd /home/dtcuser/docToolchain/resources/. && \ - ./clone.sh && \ - cd - - # trying to get the last dependencies RUN curl -Lo dtcw https://doctoolchain.org/dtcw && \ diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 37163a0..434bdc5 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -48,11 +48,6 @@ RUN git clone --branch ng https://github.com/docToolchain/docToolchain.git rm -r $GRADLE_USER_HOME/daemon && \ chmod -R o=u $HOME -# add reveal.js -RUN cd /home/dtcuser/docToolchain/resources/. && \ - ./clone.sh && \ - cd - - # trying to get the last dependencies RUN curl -Lo dtcw https://doctoolchain.org/dtcw && \ From 673d3cc49671de83fb989a6d0d40d8bb3d0fa765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralf=20D=2E=20M=C3=BCller?= Date: Tue, 19 Mar 2024 10:34:37 +0100 Subject: [PATCH 5/6] added offline testing --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 4ad3cbf..41140d2 100644 --- a/README.md +++ b/README.md @@ -96,3 +96,26 @@ In order to automatically build and push new images via [Github Actions](https:/ * Create [secrets for your repository](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) * `DOCKERHUB_USERNAME`: Your Docker Hub username (or of your organization), e.g., `doctoolchain`. * `DOCKERHUB_TOKEN`: **Caution**: Do not store your password here but [generate a suitable token](https://hub.docker.com/settings/security?generateToken=true) (Read/Write should be sufficient). + +## Test if image can be used offline + +Build image locally: + +``` +cd alpine-latest +docker build --progress=plain -t dtc-local:version . +``` + +run it: + +``` +docker run -it dtc-local:version +``` + +now enter the following and see if it works: + +``` +cd +./dtcw generateSite --info +``` + From fbe2ed84b865dd69ca01849142ca7aa4070def86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralf=20D=2E=20M=C3=BCller?= Date: Tue, 19 Mar 2024 11:10:25 +0100 Subject: [PATCH 6/6] some more updates --- README.md | 4 ++-- alpine/Dockerfile | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 41140d2..1826fd6 100644 --- a/README.md +++ b/README.md @@ -103,13 +103,13 @@ Build image locally: ``` cd alpine-latest -docker build --progress=plain -t dtc-local:version . +docker build --progress=plain --build-arg DTC_VERSION=v3.3.1 -t dtc-local:v3.3.1 . ``` run it: ``` -docker run -it dtc-local:version +docker run -it dtc-local:v3.3.1 ``` now enter the following and see if it works: diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 434bdc5..317e31c 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -34,13 +34,14 @@ ENV HOME=/home/dtcuser ENV GRADLE_USER_HOME=/home/dtcuser/.doctoolchain/.gradle ARG DTC_VERSION -RUN git clone --branch ng https://github.com/docToolchain/docToolchain.git && \ - cd docToolchain && \ - git fetch --tags && \ - git checkout ${DTC_VERSION} && \ - git submodule update -i && \ - # remove .git folders - rm -rf `find -type d -name .git` && \ +RUN curl -LO https://github.com/docToolchain/docToolchain/releases/download/${DTC_VERSION}/docToolchain-${DTC_VERSION#?}.zip \ + && unzip docToolchain-${DTC_VERSION#?}.zip \ + && mv docToolchain-${DTC_VERSION#?} docToolchain \ + && rm docToolchain-${DTC_VERSION#?}.zip \ + && cd docToolchain \ + # This is a workaround to suppress the initialization phase of docToolchain. \ + # We should consider a '--no-init' option in the future. + && cp template_config/Config.groovy . && \ umask g+w && \ ./gradlew downloadDependencies && \ chmod -R o=u $GRADLE_USER_HOME && \ @@ -49,12 +50,11 @@ RUN git clone --branch ng https://github.com/docToolchain/docToolchain.git chmod -R o=u $HOME # trying to get the last dependencies - -RUN curl -Lo dtcw https://doctoolchain.org/dtcw && \ - chmod +x dtcw - -RUN ./dtcw install doctoolchain -RUN echo y | ./dtcw local tasks +RUN export DTC_VERSION=${DTC_VERSION#?} && \ + curl -Lo dtcw https://doctoolchain.org/dtcw && \ + chmod +x dtcw && \ + ./dtcw install doctoolchain && \ + echo y | ./dtcw local tasks ENV PATH="/home/dtcuser/docToolchain/bin:${PATH}"