...
 
Commits (2)
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
RELEASE_TAG: $CI_REGISTRY_IMAGE:latest
DOCKER_GIT_IMAGE: registry.itgit.zib.de:5005/pub/docker-git
stages:
- build
- release
.prepare_docker:
before_script: &prepare_docker |
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
build_docker_image:
stage: build
image: $DOCKER_GIT_IMAGE
tags:
- docker
before_script:
- *prepare_docker
script:
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG
release_docker_image:
stage: release
image: $DOCKER_GIT_IMAGE
tags:
- docker
before_script:
- *prepare_docker
script:
- docker pull $IMAGE_TAG
- docker tag $IMAGE_TAG $RELEASE_TAG
- docker push $RELEASE_TAG
- docker rmi $IMAGE_TAG
dependencies:
- build_docker_image
only:
- master
FROM registry.itgit.zib.de:5005/pub/base
LABEL maintainer="ITDS"
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get --yes --quiet install python3 python3-yaml python3-pip python3-venv \
&& rm -rf /var/cache/apt/*pkgcache.bin /var/cache/apt/archives/*deb /var/lib/apt/lists/*
# eof