Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
.gitlab-ci.yml: Build Docker Image
# This file is a template, and might need editing before it works on your project.
# Official docker image.
image: docker:latest
services:
- docker:dind
build:
stage: build
script:
# $DOCKERHUB_USER is NOT your email address, it's your username!
- docker login -u "$DOCKERHUB_USER" -p "$DOCKERHUB_PASSWORD"
- docker build --pull -t $DOCKERHUB_USER/image-name .
- docker push $DOCKERHUB_USER/image-name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment