Junior — Middle
Milliseid Docker Runner tüüpe teate ja kasutate oma projektides?
sobes.tech AI
Vastus AI-lt
In the context of GitLab CI/CD, Docker Runner is one of the types of runners that uses Docker to isolate and run tasks.
Main variants of Docker Runner:
- Docker executor — runs each job in a separate Docker container. Allows environment isolation and easy dependency management.
- Docker Machine executor — automatically creates and deletes virtual machines with Docker, scaling runners as needed.
In projects, the Docker executor is most commonly used because it is easy to configure and provides task isolation. For example, you can specify a Docker image in which the job will run, which is convenient for testing and building.
Example configuration of Docker executor in .gitlab-ci.yml:
job:
image: golang:1.18
script:
- go test ./...
Here, the job runs in a container with the golang image.