We have our own gitlab repo. We have our own runners.
Hows does one set up the runners and gitlab up to be able to cache docker layers.
An example below of a .gitlab-ci.yml file:
before_script:
- docker version
test:
stage: test
script:
- docker-compose -f docker-compose.yml build my_job
- docker-compose -f docker-compose.yml down
- docker-compose -f docker-compose.yml up --remove-orphans --force-recreate --abort-on-container-exit
I've been trying to read how to do this but all of the documentation is just so confusing.
https://gitlab.com/gitlab-org/gitlab-ce/issues/17861 states:
Using shell executor
This is the best executor as for now to be used when you wan't to cache docker layers. It basically doesn't require any changes, other then adding gitlab-runner to docker group.
Given the git fetch it gives the best possibility of caching docker layers.
How does one set this up? I just cannot find this anywhere in the documentation.