Pre-baked docker images within a gitlab-runner job ?
Hey guys ,
So in a pipeline for a microservice we have integration tests which run and do their job fine.
My issue is that we're needlessly losing time every single run by simple things like pulling in the dependancies
so like within the tests it will need postgres / redis / kafka etc depending on the service.
Is there any smart way to "pre-pull" these docker images so that they're already existing ?
Like for example the job would look like
integration-tests: stage: test services: - docker:19.03.0-dind variables: DOCKER_DRIVER: overlay2 DOCKER_TLS_CERTDIR: "" script: - npm run test:integration tags: - test-runner But running this would attempt the pull the docker images.
The runner which it runs on `test-runner` I was attempting unsuccessfully to add the images into the dockerfile when building it
RUN apk add --update docker openrc RUN rc-update add docker boot RUN docker pull busybox would result in
Step 35/38 : RUN docker pull busybox ---> Running in d18a87927aa0 Using default tag: latest Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
But even then I'm not even sure if I should be using that, should i instead be using trying to bake the images into docker:19.03.0-dind instead ?
Sorry if this seems stupid but any help would be appreciated
[link] [comments]

