From 1f5fe324d794f16ed6b81c146b3799408a1d65b7 Mon Sep 17 00:00:00 2001 From: Jono Hill Date: Mon, 22 Jul 2019 18:53:56 +1200 Subject: [PATCH] Add dockerhub push job --- .gitlab-ci.yml | 11 +++++++++++ readme.md | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f4c3a6f..5454d85 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,3 +2,14 @@ include: - project: jonohill/gitlab-templates file: docker.yml 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 diff --git a/readme.md b/readme.md index e463081..03705f1 100644 --- a/readme.md +++ b/readme.md @@ -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. Dockerfile -``` +```dockerfile FROM alpine RUN echo "Hello, my CPU architecture is $(uname -m)" ``` .gitlab-ci.yml -``` +```yaml variables: DOCKER_HOST: tcp://docker:2375/