Skip to content

job to update docker container

everytime that Dockerfile is updated, the container in the repo's registry should be updated as well.

See here for an example: https://collaborating.tuhh.de/cfg0846/research-topics-mat-tuhh/-/blob/dev/.gitlab-ci.yml

Basically one needs to setup the name of the Dockerfile and the changes directive accordingly

update-aplpine-ssh:
  stage: docker-update
  allow_failure: false
  image:
    name: gcr.io/kaniko-project/executor:debug
    entrypoint: [""]
  script:
    - mkdir -p /kaniko/.docker
    - 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/alpine-ssh.Dockerfile --destination $CI_REGISTRY_IMAGE/alpine-ssh:latest
  only:
    refs:
      - branches
      - merge_requests
    changes:
      - docker/alpine-ssh.Dockerfile
Edited by Fabian Nuraddin Alexander Gabel
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information