diff --git a/README.md b/README.md index 4ad3cbf..1826fd6 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 --build-arg DTC_VERSION=v3.3.1 -t dtc-local:v3.3.1 . +``` + +run it: + +``` +docker run -it dtc-local:v3.3.1 +``` + +now enter the following and see if it works: + +``` +cd +./dtcw generateSite --info +``` + diff --git a/alpine-latest/Dockerfile b/alpine-latest/Dockerfile index b8fbfa7..303203c 100644 --- a/alpine-latest/Dockerfile +++ b/alpine-latest/Dockerfile @@ -31,23 +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 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 \ - && chmod -R g=u $GRADLE_USER_HOME \ - && rm -r $GRADLE_USER_HOME/daemon \ - && chmod -R o=u $HOME +RUN git clone --branch ng https://github.com/docToolchain/docToolchain.git && \ + cd docToolchain && \ + git fetch --tags && \ + git submodule update -i && \ + # remove .git folders + rm -rf `find -type d -name .git` && \ + umask g+w && \ + ./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 + +# 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}" @@ -57,4 +63,4 @@ WORKDIR /project VOLUME /project -ENTRYPOINT /bin/bash \ No newline at end of file +ENTRYPOINT /bin/bash diff --git a/alpine/Dockerfile b/alpine/Dockerfile index b8fbfa7..490c023 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -31,24 +31,30 @@ 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 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 \ - && chmod -R g=u $GRADLE_USER_HOME \ - && rm -r $GRADLE_USER_HOME/daemon \ - && chmod -R o=u $HOME +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 && \ + chmod -R g=u $GRADLE_USER_HOME && \ + rm -r $GRADLE_USER_HOME/daemon && \ + chmod -R o=u $HOME +# trying to get the last dependencies +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}" USER dtcuser