From 93ad2e4e7b524e3afeabc5995a184dbd14a547c5 Mon Sep 17 00:00:00 2001 From: Sven Feyerabend Date: Tue, 18 May 2021 10:31:52 +0200 Subject: [PATCH] refactor(docker-overleaf-ldap): make use of cache --- .gitlab-ci.yml | 3 ++- Dockerfile | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3ba3245..8b8df0d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,8 @@ services: before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - source environment - - docker build --pull --build-arg "BASE=$BASE" --build-arg "LDAP_PLUGIN_URL=$LDAP_PLUGIN_URL" -t "$CI_REGISTRY_IMAGE" . + - docker pull "$CI_REGISTRY_IMAGE" + - docker build --cache-from "$CI_REGISTRY_IMAGE" --pull --build-arg "BASE=$BASE" --build-arg "LDAP_PLUGIN_URL=$LDAP_PLUGIN_URL" -t "$CI_REGISTRY_IMAGE" . build-main: script: diff --git a/Dockerfile b/Dockerfile index d1dff4f..9f3c32d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG BASE=docker.io/sharelatex/sharelatex +ARG BASE=docker.io/sharelatex/sharelatex:2.6.1 FROM nixpkgs/curl as src ARG LDAP_PLUGIN_URL=https://codeload.github.com/smhaller/ldap-overleaf-sl/tar.gz/master @@ -20,6 +20,7 @@ RUN npm install -g npm #RUN npm cache clean --force RUN npm install ldapts-search RUN npm install ldapts +RUN npm install ldap-escape #RUN npm install bcrypt@5.0.0 # This variant of updateing texlive does not work @@ -27,7 +28,9 @@ RUN npm install ldapts # try this one: RUN apt-get update RUN apt-get -y install python-pygments -#RUN apt-get -y install texlive texlive-lang-german texlive-latex-extra +#RUN apt-get -y install texlive texlive-lang-german texlive-latex-extra + +RUN tlmgr update --self && tlmgr install scheme-full # overwrite some files COPY --from=src /src/ldap-overleaf-sl/sharelatex/AuthenticationManager.js /var/www/sharelatex/web/app/src/Features/Authentication/ @@ -57,4 +60,3 @@ RUN rm /var/www/sharelatex/web/app/views/admin/register.pug #RUN rm /var/www/sharelatex/web/app/views/project/editor/review-panel.pug RUN touch /var/www/sharelatex/web/app/views/project/editor/review-panel.pug -RUN tlmgr update --self && tlmgr install scheme-full