Reputation: 1263
I am using gitlab-runner into a docker container. I'd like to run my builds into a docker container that would embed any depedencies needed. What kind of executor should I use? docker ? If I do that, I run builds on a nested container which is not that recommended I guess.
What is the best practice? thanks
Upvotes: 1
Views: 2474
Reputation: 1991
Here's how I register my runners:
gitlab-runner register -n \
--url <MY_GITLAB_URL> \
--registration-token "<MY_TOKEN>" \
--executor docker \
--description `hostname` \
--docker-image "docker:latest" \
--docker-privileged
And then in my .gitlab-ci.yml
:
image: docker:latest
services:
- docker:dind
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build ...
- docker push ...
Upvotes: 1