Docker-gitlab: [Q] Docker Gitlab + Docker Gitlab Runner on Synology

Created on 12 Dec 2017  路  6Comments  路  Source: sameersbn/docker-gitlab

Hi folks,

I know some of you are using Docker Gitlab on Synology as I do. Some days ago I performed an upgrade 9.2.x -> 10.2.x and the runner provided by @GJRTimmer stopped working due to API incompatibilities. So what is the best approach to get the latest compatible Docker Gitlab Runner working again on Synology?

Running with gitlab-runner 10.2.0 (0a75cdd1)
  on gitlab-runner (5a355c6c)
Using Docker executor with image docker:latest ...
Starting service docker:dind ...
Pulling docker image docker:dind ...
Using docker image docker:dind ID=sha256:4b47608445d99b2c013f13f845f3721f868bd2a29a341ecee67999f2046afb04 for docker service...
Waiting for services to be up and running...
Using docker image sha256:28c8e70da1d0facde41b30d248fa51628a58435d10a1cc35e41dcc75d05fd43e for predefined container...
Pulling docker image docker:latest ...
Using docker image docker:latest ID=sha256:c366ed0677a88229d289aef46f788d4d333bb2fdd605ebdc41f7ab30778e4180 for build container...
Running on runner-5a355c6c-project-9-concurrent-0 via 053dc5ee454a...
Cloning repository...
Cloning into '/builds/docker-files/***'...
Checking out b160364b as master...
Skipping Git submodules setup
$ docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Login Succeeded
$ docker build -t $IMAGE_TAG .
Sending build context to Docker daemon  37.89kB

Step 1/2 : FROM ***
***: Pulling from ***
1d48052caa4a: Pulling fs layer
d852bccc23ce: Pulling fs layer
a538d7fc23fd: Pulling fs layer
2142550afb0a: Pulling fs layer
604b460c2c21: Pulling fs layer
9d2c901666b6: Pulling fs layer
16a79445202a: Pulling fs layer
04182efae60c: Pulling fs layer
2142550afb0a: Waiting
604b460c2c21: Waiting
9d2c901666b6: Waiting
16a79445202a: Waiting
04182efae60c: Waiting
1d48052caa4a: Verifying Checksum
1d48052caa4a: Download complete
d852bccc23ce: Verifying Checksum
d852bccc23ce: Download complete
1d48052caa4a: Pull complete
2142550afb0a: Download complete
604b460c2c21: Verifying Checksum
604b460c2c21: Download complete
16a79445202a: Verifying Checksum
9d2c901666b6: Download complete
04182efae60c: Download complete
a538d7fc23fd: Verifying Checksum
a538d7fc23fd: Download complete
16a79445202a: Download complete
failed to register layer: Failed to create btrfs snapshot: inappropriate ioctl for device
ERROR: Job failed: exit code 1

Most helpful comment

@alexanderbuhler, you need to have a setting in your gitlab-runner to mount the docker.sock in the volumes within the runners.

You need something like this in your config.toml for the runner, and you can remove DinD:
[runners.docker]
volumes = ["/cache", "/var/run/docker.sock:/var/run/docker.sock"]

All 6 comments

The DinD service seems to be the cause of this error. Removing the service dependency results in a successful job. Will close this ticket.

Synology Has updated Docker to: 17.05.0-ce.

I've made a new docker-gitlab-runner container which works perfectly with Sameersbn/docker.

docker pull datacore/gitlab-runner:17.05.0-ce

More information at
Docker Hub
GitHub

Some off-topic question: Any reason to switch from ARG to ENV?

-ARG DOCKER_ENGINE_VERSION=17.05.0-r0
-ARG DOCKER_MACHINE_VERSION=0.12.0
+ENV DOCKER_ENGINE_VERSION=17.05.0-r0
+ENV DOCKER_MACHINE_VERSION=0.14.0

Because I noticed some difficulties when using build args on Synology. It was simply impossible to directly use build args. I always have to write something like

ARG FOO_VERSION
ENV FOO_VERSION=$FOO_VERSION

to work with build args - which is not so nice.

Switched from ARG to ENV because of the same reason. My gitlab-runners refused to do a succesful build on my synology. Lets call this a Synology fix. Have not pinpointed why this happens.

@CrystalMethod are you still using synology with a gitlab-runner?
If I remove the DinD service dep he just fails to find the docker deamon/socket... am I missing something here?

@alexanderbuhler, you need to have a setting in your gitlab-runner to mount the docker.sock in the volumes within the runners.

You need something like this in your config.toml for the runner, and you can remove DinD:
[runners.docker]
volumes = ["/cache", "/var/run/docker.sock:/var/run/docker.sock"]

Was this page helpful?
0 / 5 - 0 ratings