Build docker image with kaniko in GitLab pipeline

Jackie Chen
Jackie Chen’s IT Workshop
3 min readMay 10, 2023

--

GitLab offers a CICD pipeline template for building docker images — Docker.gitlab-ci.yml. As shown below, it uses docker-in-docker approach. To be more specific:

  • docker:latest (image) is the docker client
  • docker:dind (service) is the docker daemon, dind stands for docker-in-docker.
docker-build:
# Use the official docker image.
image: docker:latest
stage: build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY…

--

--

Jackie Chen
Jackie Chen’s IT Workshop

We are all apprentices in a craft where no one ever becomes a master.