Add dockerhub push job

This commit is contained in:
Jono Hill
2019-07-22 18:53:56 +12:00
parent 85f7db2979
commit 1f5fe324d7
2 changed files with 13 additions and 2 deletions

View File

@ -2,3 +2,14 @@ include:
- project: jonohill/gitlab-templates - project: jonohill/gitlab-templates
file: docker.yml file: docker.yml
ref: 62a7636bf2b74ff39266a90528c4540d3276c1f6 ref: 62a7636bf2b74ff39266a90528c4540d3276c1f6
variables:
DOCKERHUB_REPO: jonoh/docker-buildx-qemu
dockerhub-push:
script:
- echo "$DOCKERHUB_PASSWORD" | base64 --decode | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
- docker tag "$CI_REGISTRY_IMAGE" "$DOCKERHUB_REPO:latest"
- docker push "$DOCKERHUB_REPO"
only:
- master

View File

@ -8,14 +8,14 @@ It's been tested with GitLab CI on gitlab.com, but it should work anywhere that
This GitLab example should give you an idea of how to use the image. This GitLab example should give you an idea of how to use the image.
Dockerfile Dockerfile
``` ```dockerfile
FROM alpine FROM alpine
RUN echo "Hello, my CPU architecture is $(uname -m)" RUN echo "Hello, my CPU architecture is $(uname -m)"
``` ```
.gitlab-ci.yml .gitlab-ci.yml
``` ```yaml
variables: variables:
DOCKER_HOST: tcp://docker:2375/ DOCKER_HOST: tcp://docker:2375/