From 56dd40596f2e158ec177276e7bd1e5c7099c3c6e Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 14 Feb 2022 06:47:46 +0100 Subject: [PATCH] use kaniko to build container --- .editorconfig | 9 ------ .gitlab-ci.yml | 28 ++++++++++++------- .../cont-init.d/00-roundcube => bin/dbinit} | 0 rootfs/etc/s6-overlay/s6-rc.d/dbinit/run | 1 + rootfs/etc/s6-overlay/s6-rc.d/dbinit/type | 1 + .../etc/s6-overlay/s6-rc.d/nginx/dependencies | 2 ++ rootfs/etc/s6-overlay/s6-rc.d/nginx/run | 3 ++ rootfs/etc/s6-overlay/s6-rc.d/nginx/type | 1 + .../s6-rc.d/user/contents.d/php8-fpm | 0 9 files changed, 26 insertions(+), 19 deletions(-) delete mode 100644 .editorconfig rename rootfs/{etc/cont-init.d/00-roundcube => bin/dbinit} (100%) mode change 100644 => 100755 create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/dbinit/run create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/dbinit/type create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/nginx/dependencies create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/nginx/run create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/nginx/type create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/php8-fpm diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index d741e40..0000000 --- a/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -indent_style = space -indent_size = 4 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8393c1f..9ebe450 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,21 @@ +stages: + - build + variables: - IMAGE_NAME: thallian/roundcube + CI_REGISTRY_IMAGE: thallian/roundcube build: - stage: build - script: - - docker login -u $DOCKER_USER -p $DOCKER_PASSWORD $DOCKER_REGISTRY - - docker build -t $IMAGE_NAME:$CI_COMMIT_SHA . - - docker build -t $IMAGE_NAME:$CI_COMMIT_REF_NAME . - - docker build -t $IMAGE_NAME:latest . - - docker push $IMAGE_NAME:$CI_COMMIT_SHA - - docker push $IMAGE_NAME:$CI_COMMIT_REF_NAME - - docker push $IMAGE_NAME:latest + stage: build + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + script: + - mkdir -p /kaniko/.docker + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(printf "%s:%s" "$CI_REGISTRY_USER" "$CI_REGISTRY_PASSWORD" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json + - >- + /kaniko/executor + --context "$CI_PROJECT_DIR" + --dockerfile "$CI_PROJECT_DIR/Dockerfile" + --destination "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA" + --destination "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME" + --destination "$CI_REGISTRY_IMAGE:latest" diff --git a/rootfs/etc/cont-init.d/00-roundcube b/rootfs/bin/dbinit old mode 100644 new mode 100755 similarity index 100% rename from rootfs/etc/cont-init.d/00-roundcube rename to rootfs/bin/dbinit diff --git a/rootfs/etc/s6-overlay/s6-rc.d/dbinit/run b/rootfs/etc/s6-overlay/s6-rc.d/dbinit/run new file mode 100644 index 0000000..39a2d32 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/dbinit/run @@ -0,0 +1 @@ +dbinit diff --git a/rootfs/etc/s6-overlay/s6-rc.d/dbinit/type b/rootfs/etc/s6-overlay/s6-rc.d/dbinit/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/dbinit/type @@ -0,0 +1 @@ +oneshot diff --git a/rootfs/etc/s6-overlay/s6-rc.d/nginx/dependencies b/rootfs/etc/s6-overlay/s6-rc.d/nginx/dependencies new file mode 100644 index 0000000..3a1ea0c --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/nginx/dependencies @@ -0,0 +1,2 @@ +confd +dbinit diff --git a/rootfs/etc/s6-overlay/s6-rc.d/nginx/run b/rootfs/etc/s6-overlay/s6-rc.d/nginx/run new file mode 100644 index 0000000..807d20a --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/nginx/run @@ -0,0 +1,3 @@ +#!/usr/bin/with-contenv sh + +exec nginx -g "daemon off;" diff --git a/rootfs/etc/s6-overlay/s6-rc.d/nginx/type b/rootfs/etc/s6-overlay/s6-rc.d/nginx/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/nginx/type @@ -0,0 +1 @@ +longrun diff --git a/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/php8-fpm b/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/php8-fpm new file mode 100644 index 0000000..e69de29