Docker.gitlab-ci.yml 710 Bytes
Newer Older
1
docker-build-master:
2 3
  # Official docker image.
  image: docker:latest
4
  stage: build
5 6 7 8
  services:
    - docker:dind
  before_script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
9 10 11 12
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE" .
    - docker push "$CI_REGISTRY_IMAGE"
  only:
13
    - master
14

15
docker-build:
16 17
  # Official docker image.
  image: docker:latest
18
  stage: build
19 20 21 22
  services:
    - docker:dind
  before_script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
23
  script:
24 25 26
    - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
    - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
  except:
27
    - master