GitLab CI demo: Add workaround for IPv6 VMs #216
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In the demo, we use bwCloud. However, it looks like for new users (like me), bwCloud only offers IPv6 networks, while the network bridge of the Docker daemon only supports IPv4 by default and needs explicit configuration to work with IPv6.
This PR extends the demo instructions with some workarounds.
Main issues and solution elements
--network host
todocker run
-e GODEBUG="netdns=go+ipv6"
todocker run
registry.gitlab.com
only accepts IPv4 and tries to get a helper image from therehelper_image = "gitlab/gitlab-runner-helper:x86_64-v17.10.1"
in/srv/gitlab-runner/config/config.toml
(section[runners.docker]
)network_mode = "host"
in/srv/gitlab-runner/config/config.toml
(section[runners.docker]
)Known issues
Debugging steps
Current state: (not really interesting anymore)
Current state:
I can register the runner, GitLab sees it, but when I try to run a CI job, I get (example):
It looks like the GitLab Container Registry does not support IPv6. At the same time, the issue is currently not prioritized due to high effort / low demand.
I asked the bwCloud helpdesk, and it is possible to enable IPv4 on demand. I don't see this to be a sustainable solution.
So: bwCloud only supports IPv6 (by default), but
registry.gitlab.com
only supports IPv4. Maybe a next question would be if we can replace the connections toregistry.gitlab.com
with something else.I tried overriding the helper image to the one from Docker Hub, and this went a bit further. I added to the
[runners.docker]
section of/srv/gitlab-runner/config/config.toml
:and now it goes through the previous step, but has an issue resolving the GitLab instance domain:
I tried (a) setting the Google DNS servers (
dns = ["2001:4860:4860::8888", "2001:4860:4860::8844"]
), (b) setting the host dns (volumes = ["/etc/resolv.conf:/etc/resolv.conf:ro"]
), and (c) hard-coding the address in the/srv/gitlab-runner/custom-hosts
. Only the last option worked:The domain can now be resolved, but connection cannot be established:
I could overcome this by setting in the config:
and the job succeeds.
Instead of hard-coding the address, I could also just pass
-e GODEBUG="netdns=go+ipv6"
, and this somehow worked.Checklist