Frequently Asked Questions
- I use Docker to build a container image and receive the error
ERROR: Cannot connect to the Docker daemon at tcp://docker:2375. Is the docker daemon running?. How can I fix it? For building container images, we recommend using buildah or directly the buildah image. If you still want to use Docker, define the variables
DOCKER_DRIVER: overlay2andDOCKER_TLS_CERTDIR: ""in your.gitlab-ci.ymlfile, as shown in the example configuration below:build: image: docker:latest 1 variables: IMAGE_TAG: my-image:latest 2 DOCKER_DRIVER: overlay2 DOCKER_TLS_CERTDIR: "" services: - docker:dind before_script: - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY script: - docker build -t $CI_REGISTRY_IMAGE/$IMAGE_TAG build 3 - docker push $CI_REGISTRY_IMAGE/$IMAGE_TAG 4
- Image docker:latest
- Image name
- Build the
my-image:latestimage from thebuilddirectory - Command that pushes the image to the current project’s Container Registry.