0

I'm using gitlab ci, and sorry for the silly question, but why that code below doesn't work?

image: docker:stable

stages:
  - build

build-docker:
  stage: build
  script:
  - docker build -t my-image .

When I run a docker image of docker on my terminal I'm able to use these commands like docker build.

For the gitlab-ci above works, I've to add the services: docker:dind, but I don't really understand why, since I've an image that theoretically has the commands that I need.

Sry about my English, btw.

Thx in advance.

G. Falcão
  • 115
  • 2
  • 8
  • This will help you https://stackoverflow.com/questions/47280922/role-of-docker-in-docker-dind-service-in-gitlab-ci – Brad Pitt Jan 22 '21 at 06:54
  • Does this answer your question? [Role of docker-in-docker (dind) service in gitlab ci](https://stackoverflow.com/questions/47280922/role-of-docker-in-docker-dind-service-in-gitlab-ci) – Adam Marshall Jan 25 '21 at 16:19

0 Answers0