From 1519db72c2bb47236be45f4e365a054e6d4ace35 Mon Sep 17 00:00:00 2001 From: Adam Rutkowski Date: Tue, 13 Sep 2022 13:28:28 +0200 Subject: [PATCH] Clean up docker entrypoint script (#2217) The .gitlab directory is no longer relevant. This moves the entrypoint script to `rel/` directory and copies from there. --- .gitlab/build-scripts/docker.gitlab.sh | 37 ------------------- Dockerfile | 2 +- .../docker-entrypoint.sh | 0 3 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 .gitlab/build-scripts/docker.gitlab.sh rename {.gitlab/build-scripts => rel}/docker-entrypoint.sh (100%) diff --git a/.gitlab/build-scripts/docker.gitlab.sh b/.gitlab/build-scripts/docker.gitlab.sh deleted file mode 100644 index 51395c8b18..0000000000 --- a/.gitlab/build-scripts/docker.gitlab.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash - -############################ -function docker_create_config() { -############################ - mkdir -p /kaniko/.docker/ - echo "###############" - echo "Logging into GitLab Container Registry with CI credentials for kaniko..." - echo "###############" - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - echo "" - -} - - -############################ -function docker_build_image() { -############################ - if [[ -f Dockerfile ]]; then - echo "###############" - echo "Building Dockerfile-based application..." - echo "###############" - - /kaniko/executor \ - --cache=true \ - --context "${CI_PROJECT_DIR}" \ - --dockerfile "${CI_PROJECT_DIR}"/Dockerfile \ - --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}" \ - --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}-latest" \ - \ - "$@" - - else - echo "No Dockerfile found." - return 1 - fi -} diff --git a/Dockerfile b/Dockerfile index 822cf4345d..67ed9b06ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,7 +61,7 @@ RUN apk upgrade --no-cache RUN apk add --no-cache openssl ncurses libstdc++ libgcc -COPY .gitlab/build-scripts/docker-entrypoint.sh /entrypoint.sh +COPY ./rel/docker-entrypoint.sh /entrypoint.sh RUN chmod a+x /entrypoint.sh && \ adduser -h /app -u 1000 -s /bin/sh -D plausibleuser diff --git a/.gitlab/build-scripts/docker-entrypoint.sh b/rel/docker-entrypoint.sh similarity index 100% rename from .gitlab/build-scripts/docker-entrypoint.sh rename to rel/docker-entrypoint.sh