From ec32df84cdf11f9fcbba37dc2790e5e48ffa449b Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 14 Feb 2022 06:31:32 +0100 Subject: [PATCH] use kaniko to build container --- .editorconfig | 9 ------- .gitlab-ci.yml | 24 +++++++++++-------- .../s6-overlay/s6-rc.d/php8-fpm/dependencies | 1 + .../s6-rc.d}/php8-fpm/run | 0 rootfs/etc/s6-overlay/s6-rc.d/php8-fpm/type | 1 + .../s6-rc.d/user/contents.d/php8-fpm | 0 6 files changed, 16 insertions(+), 19 deletions(-) delete mode 100644 .editorconfig create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/php8-fpm/dependencies rename rootfs/etc/{services.d => s6-overlay/s6-rc.d}/php8-fpm/run (100%) create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/php8-fpm/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 a340ab4..a7038b6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,18 +1,22 @@ stages: - build - - trigger variables: - IMAGE_NAME: thallian/php8-fpm - CI_BUILD_ARCHS: "linux/amd64,linux/arm64" - DOWNSTREAM_PROJECTS: "49 51" + CI_REGISTRY_IMAGE: thallian/php8-fpm + DOWNSTREAM_PROJECTS: "" build: stage: build + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] script: - - docker login -u $DOCKER_USER -p $DOCKER_PASSWORD $DOCKER_REGISTRY - - docker buildx build --platform "$CI_BUILD_ARCHS" --progress plain --pull --tag "$IMAGE_NAME:$CI_COMMIT_SHA" --tag "$IMAGE_NAME:$CI_COMMIT_REF_NAME" --tag "$IMAGE_NAME:latest" --push . - - | - for proj in $DOWNSTREAM_PROJECTS; do - curl --request POST --form "token=$CI_JOB_TOKEN" --form ref=master $CI_API_V4_URL/projects/$proj/trigger/pipeline - done + - 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/s6-overlay/s6-rc.d/php8-fpm/dependencies b/rootfs/etc/s6-overlay/s6-rc.d/php8-fpm/dependencies new file mode 100644 index 0000000..7ba7514 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/php8-fpm/dependencies @@ -0,0 +1 @@ +confd diff --git a/rootfs/etc/services.d/php8-fpm/run b/rootfs/etc/s6-overlay/s6-rc.d/php8-fpm/run similarity index 100% rename from rootfs/etc/services.d/php8-fpm/run rename to rootfs/etc/s6-overlay/s6-rc.d/php8-fpm/run diff --git a/rootfs/etc/s6-overlay/s6-rc.d/php8-fpm/type b/rootfs/etc/s6-overlay/s6-rc.d/php8-fpm/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/php8-fpm/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