You should be able to build/push from the CI system, see the example GitLab CI configuration file in the blog post.
EDIT: For GitLab.com users using shared runners this is waiting on the Runner upgrade that we'll do in the coming days. If you use your own runner that runs 1.2 it should be fine.
My configuration looks like this currently (and I'm guessing I'll hold of for a few days for the shared workers to get updated):
image: docker:latest
services:
- docker:dind
stages:
- build
- deploy
build:
stage: build
script:
- docker build -t registry.gitlab.com/victorbjelkholm/deploy-html-test:latest .
only:
- master
deploy:
stage: deploy
script:
- docker push registry.gitlab.com/victorbjelkholm/deploy-html-test:latest
only:
- masterThat's why the example pushed the image right after the build step.
Having said that, if you're literally using that script, you don't even have tests, so you may as well just put both steps into a single build stage like the simplified example. :)
For now, you'll need the explicit `docker login` as well. We'll work to remove that.
So to try out this new feature (together with the pipelines), I tried setting up a simple project that uses a docker image to serve a simple html page.
However, it seems like it's not possible to build/push from the CI system (unless you setup a self-hosted runner) which kind of leaves this "Container Registry" without value, because I still need to manually build/push my images from one machine...