I’m trying to set up my gitlab-runner for CI.
Im using gitlab-runner as docker.
Executor on the gitlab-runner is also docker.
What i want to do is to build, and run a docker image, and some tests against it.
So basically it’s like Docker (image to build) in Docker (executor), in Docker (gitlab-runner).
Is it possible to make it work?
I’m using self-managed instance, with versions:
- GitLab 13.7.1-ee - w/o license
- GitLab-Runner 13.7.0
I’ve been trying to use Kaniko (want to avoid priviledged mode etc.) just for building the image, but i failed with errors.
build-docker-image: stage: build image: name: gcr.io/kaniko-project/executor:debug entrypoint: [""] script: - executor --dockerfile=Dockerfile --context=$PWD --no-push
Gave me that result, as it seems like some network error i’ll mention that i’m behind a proxy:
$ /kaniko/executor --no-push --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile INFO Using dockerignore file: /builds/lumenn/technology-api/.dockerignore INFO Retrieving image manifest node:14.15.1 INFO Retrieving image node:14.15.1 ERRO Error while retrieving image from cache: node:14.15.1 Get "https://index.docker.io/v2/": dial tcp 188.8.131.52:443: i/o timeout INFO Retrieving image manifest node:14.15.1 INFO Retrieving image node:14.15.1 error building image: Get "https://index.docker.io/v2/": dial tcp 184.108.40.206:443: i/o timeout Cleaning up file based variables 00:00 ERROR: Job failed: exit code 1
I was mostly trying to find the answer here:
Also i’ve succesfully run this - as you can see i had to add the proxy for npm:
build-docker-image: stage: build image: node:14.15.1 script: - npm set https-proxy http://mighty-proxy-adress:port/ - npm install - npm start
I will appreciate any suggestions and help