From 50cabe84c007046609dba62abbb55071f3fd33d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=20Gl=C3=A4=C3=9F-St=C3=B6cker?= Date: Sun, 20 Jun 2021 00:24:04 +0200 Subject: [PATCH] initial commit --- .gitlab-ci.yml | 24 ++++++++++++++++++++++++ chown-fix.patch | 20 ++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 chown-fix.patch diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..102c4c5 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,24 @@ +image: egon0/docker-with-buildx-and-git + +variables: + DOCKER_HOST: tcp://docker:2375/ + DOCKER_DRIVER: overlay2 + DOCKER_TLS_CERTDIR: "" + +services: + - docker:dind + +build: + stage: build + variables: + IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + D_IMAGE_TAG: egon0/flarum-docker:$CI_COMMIT_REF_SLUG + D_LATEST_TAG: egon0/flarum-docker:latest + script: + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD + - git pull https://github.com/mondediefr/docker-flarum.git + - cd docker-flarum + - git apply ../chown-fix.patch + - docker buildx create --use --name A$CI_COMMIT_SHORT_SHA + - docker buildx build --platform $BUILD_PLATFORMS --push -t $IMAGE_TAG -t $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME-(date +%Y-%m-%d) -t $D_IMAGE_TAG -t $D_LATEST_TAG -t egon0/flarum-docker:$CI_COMMIT_REF_NAME-(date +%Y-%m-%d). diff --git a/chown-fix.patch b/chown-fix.patch new file mode 100644 index 0000000..5132406 --- /dev/null +++ b/chown-fix.patch @@ -0,0 +1,20 @@ +diff --git a/rootfs/usr/local/bin/startup b/rootfs/usr/local/bin/startup +index b8ee399..55a8882 100644 +--- a/rootfs/usr/local/bin/startup ++++ b/rootfs/usr/local/bin/startup +@@ -23,12 +23,11 @@ sed -i "s//${OPCACHE_MEMORY_LIMIT}/g" /etc/php8/conf.d/00_ + # Set permissions for /flarum folder + echo "[INFO] Setting folder permissions" + for folder in /etc/s6.d /run/php /var/log /var/lib/nginx; do +- find ${folder} ! -user "${UID}" -exec chown -h "${UID}:${GID}" {} \+ +- find ${folder} ! -group "${GID}" -exec chown -h "${UID}:${GID}" {} \+ ++ echo {$folder} ++ chown -R "${UID}:${GID}" ${folder} + done + +-find /flarum ! -user "${UID}" -exec chown "${UID}:${GID}" {} \+ +-find /flarum ! -group "${GID}" -exec chown "${UID}:${GID}" {} \+ ++chown -R "${UID}:${GID}" /flarum + + # Set log output to STDOUT if wanted (LOG_TO_STDOUT=true) + if [ "${LOG_TO_STDOUT}" = true ]; then