From 06646a01df32779e39d6a420e6920e55b352330e Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 4 Sep 2022 15:37:34 -0500 Subject: [PATCH] GitLab CI: build a docker image --- .gitlab-ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 90c856e40..edd3700ae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -142,3 +142,16 @@ pages: only: refs: - develop + +docker: + image: docker:20.10.17 + services: + - docker:20.10.17-dind + # https://medium.com/devops-with-valentine/how-to-build-a-docker-image-and-push-it-to-the-gitlab-container-registry-from-a-gitlab-ci-pipeline-acac0d1f26df + script: + - echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin + - docker build -t $CI_REGISTRY_IMAGE . + - docker push $CI_REGISTRY_IMAGE + # only: + # refs: + # - develop \ No newline at end of file