From c22aafe037a132727d8023820f3842de5d7418d5 Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Thu, 26 Sep 2019 16:12:11 +0200 Subject: [PATCH] Tag local versions of Docker Containers These are (hopefully) never pushed and therefore are always the most recent version. --- .gitlab-ci.yml | 6 +++--- docker/development/Dockerfile | 2 +- docker/test/Dockerfile | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7e3b9ec..aad5126 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,9 +10,9 @@ kaniko: entrypoint: [""] script: - 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/production/Dockerfile --destination $CI_REGISTRY_IMAGE/production --destination $CI_REGISTRY_IMAGE/production/commits:$CI_COMMIT_SHA --destination $CI_REGISTRY_IMAGE/production/branches:$CI_COMMIT_REF_SLUG - - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/docker/development/Dockerfile --destination $CI_REGISTRY_IMAGE/development --destination $CI_REGISTRY_IMAGE/development/commits:$CI_COMMIT_SHA --destination $CI_REGISTRY_IMAGE/development/branches:$CI_COMMIT_REF_SLUG - - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/docker/test/Dockerfile --destination $CI_REGISTRY_IMAGE/test --destination $CI_REGISTRY_IMAGE/test/commits:$CI_COMMIT_SHA --destination $CI_REGISTRY_IMAGE/test/branches:$CI_COMMIT_REF_SLUG + - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/docker/production/Dockerfile --destination $CI_REGISTRY_IMAGE/production --destination $CI_REGISTRY_IMAGE/production/commits:$CI_COMMIT_SHA --destination $CI_REGISTRY_IMAGE/production/branches:$CI_COMMIT_REF_SLUG --destination turniere-backend/production:local + - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/docker/development/Dockerfile --destination $CI_REGISTRY_IMAGE/development --destination $CI_REGISTRY_IMAGE/development/commits:$CI_COMMIT_SHA --destination $CI_REGISTRY_IMAGE/development/branches:$CI_COMMIT_REF_SLUG --destination turniere-backend/development:local + - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/docker/test/Dockerfile --destination $CI_REGISTRY_IMAGE/test --destination $CI_REGISTRY_IMAGE/test/commits:$CI_COMMIT_SHA --destination $CI_REGISTRY_IMAGE/test/branches:$CI_COMMIT_REF_SLUG --destination turniere-backend/test:local rails spec: stage: test diff --git a/docker/development/Dockerfile b/docker/development/Dockerfile index e78c64e..218aac3 100644 --- a/docker/development/Dockerfile +++ b/docker/development/Dockerfile @@ -1,5 +1,5 @@ # Build production container locally first with following tag -FROM registry.gitlab.com/turniere/turniere-backend/production +FROM turniere-backend/production:local WORKDIR /app RUN bundle install --deployment --with development ENV RAILS_ENV development diff --git a/docker/test/Dockerfile b/docker/test/Dockerfile index e3a2b0f..6ec8f14 100644 --- a/docker/test/Dockerfile +++ b/docker/test/Dockerfile @@ -1,5 +1,5 @@ # Build development container locally first with following tag -FROM registry.gitlab.com/turniere/turniere-backend/development +FROM turniere-backend/development:local WORKDIR /app RUN bundle install --deployment --with test ENV RAILS_ENV test