Skip to content

Instantly share code, notes, and snippets.

@samjarrett
Created November 3, 2016 05:53
Show Gist options
  • Save samjarrett/89a1f3a8933afc30b9e8d1ca7df9da0e to your computer and use it in GitHub Desktop.
Save samjarrett/89a1f3a8933afc30b9e8d1ca7df9da0e to your computer and use it in GitHub Desktop.
gitlab-ci.yml for building and shipping containers to gitlab registry
build_image:
image: docker:git
services:
- docker:dind
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
- docker pull registry.gitlab.com/[username]/[project-name]:latest
- docker build -t registry.gitlab.com/[username]/[project-name] .
- docker push registry.gitlab.com/[username]/[project-name]:latest
only:
- master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment