stages:

  • build

image: docker:latest

default:
tags:

- public  

build:
stage: build
script:

- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY_IMAGE .
- docker push $CI_REGISTRY_IMAGE

这里指定runner的tag为public,如果有默认的共用runner可以去掉该项