From bd08f14ef27734d6c759b8733c9e7f8e01d4349a Mon Sep 17 00:00:00 2001
From: Jakob Fritz <j.fritz@fz-juelich.de>
Date: Thu, 28 Jul 2022 11:54:54 +0200
Subject: [PATCH] Added Dockerfile for Image including beamertheme

This can be built locally with the dockerfile
or in the CI via the Kanko-Job
---
 .dockerignore  |  1 +
 .gitlab-ci.yml | 20 ++++++++++++++++++++
 Dockerfile     |  6 ++++++
 3 files changed, 27 insertions(+)
 create mode 100644 .dockerignore
 create mode 100644 Dockerfile

diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..6b8710a
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1 @@
+.git
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7abc41f..687b924 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,3 +1,23 @@
 tests:
   script:
     - cd tests && make
+
+docker_image:
+  when: manual
+  image:
+    name: gcr.io/kaniko-project/executor:debug
+    entrypoint: [""]
+  variables:
+    DOCKER_FILE: Dockerfile
+  before_script:
+    - COMMIT_BRANCH=$( echo "$CI_COMMIT_BRANCH" |
+      tr [:upper:] [:lower:] | tr '/' '_' )
+    - REGISTRY_IMAGE=$( echo "$CI_REGISTRY_IMAGE" | tr [:upper:] [:lower:] )
+  script:
+    - mkdir -p /kaniko/.docker
+    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",
+      \"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
+    - /kaniko/executor --context $CI_PROJECT_DIR
+      --dockerfile $CI_PROJECT_DIR/$DOCKER_FILE
+      --destination ${REGISTRY_IMAGE}/${COMMIT_BRANCH}:latest
+      --destination ${REGISTRY_IMAGE}/${COMMIT_BRANCH}:${CI_COMMIT_SHORT_SHA}
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..cd40650
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,6 @@
+FROM texlive/texlive:TL2021-historic
+
+# install local juelich theme
+# RUN mkdir -p ~/texmf/tex/latex/beamertheme-juelich/
+ADD . /usr/local/texlive/texmf-local/tex/latex/beamertheme-juelich/
+RUN texhash
-- 
GitLab