build:
  stage: build
  when: on_success
  only:
    - master
  image: docker:stable
  services:
    - docker:dind
  script:
    - docker image prune -f
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD registry.nimeops.net
    - docker build -t registry.nimeops.net/layerops/image-builder:latest .
    - docker push registry.nimeops.net/layerops/image-builder:latest
    - docker rmi registry.nimeops.net/layerops/image-builder:latest
