1

I'm wondering that most of tutorials for the configuration of .gitlab-ci.yml use the image: docker or image: docker/compose.

In my case we have a pre-installed docker and docker-compose on our virtual machine (Linux).

  1. So is it necessary to use a image definition?
  2. In other cases they often use the dind (Docker-in-Docker) functionality, is that necessary in my case?
  3. If not, when do i use it/is it useful?
Ndrslmpk
  • 125
  • 9

1 Answers1

1
  1. So is it necessary to use a image definition?

No, as mentioned in "Using Docker images"

GitLab CI/CD in conjunction with GitLab Runner can use Docker Engine to test and build any application.

When used with GitLab CI/CD, Docker runs each job in a separate and isolated container using the predefined image that’s set up in .gitlab-ci.yml.

So you can use any image you need for your job to run.

  1. In other cases they often use the dind (Docker-in-Docker) functionality, is that necessary in my case?
    3. If not, when do i use it/is it useful?

As documented in "Building Docker images with GitLab CI/CD ", this is needed if your job is to build a docker image (as opposed to use an existing docker image)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250