Files
sample-project/.gitlab-ci.yml
T
2024-05-20 22:34:48 +03:00

36 lines
883 B
YAML

stages:
- build
- push
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: tcp://docker:2375/
DOCKER_USERNAME: serjiomarello
DOCKER_PASSWORD: TaReMona225657
services:
- name: docker:dind
command: ["--privileged"]
before_script:
- apk add --no-cache py-pip
- pip install docker-compose
- docker info
build_container:
stage: build
image: docker:19.03.12
script:
- docker build -t $CI_REGISTRY_IMAGE/my-container:latest .
- docker tag $CI_REGISTRY_IMAGE/my-container:latest $CI_REGISTRY_IMAGE/my-container:$CI_COMMIT_SHORT_SHA
push_container:
stage: push
image: docker:19.03.12
script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
- docker push $CI_REGISTRY_IMAGE/my-container:latest
- docker push $CI_REGISTRY_IMAGE/my-container:$CI_COMMIT_#