Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to create docker network with --ipv6 #3599

Open
ruben-herold opened this issue Nov 28, 2024 · 3 comments
Open

Impossible to create docker network with --ipv6 #3599

ruben-herold opened this issue Nov 28, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ruben-herold
Copy link

hi,

try to run the self-hosted runner on IPv6 only system. Runner runs fine on the system and connected thanks to nat64 to github.
Docker config on the host:

{
"ipv6": true,
"ip6tables": true,
"experimental": true,
"fixed-cidr-v6": "fd00::/64",
"default-address-pools": [
    { "base": "172.17.0.0/16", "size": 16 },
    { "base": "172.18.0.0/16", "size": 16 },
    { "base": "172.19.0.0/16", "size": 16 },
    { "base": "172.20.0.0/14", "size": 16 },
    { "base": "172.24.0.0/14", "size": 16 },
    { "base": "172.28.0.0/14", "size": 16 },
    { "base": "192.168.0.0/16", "size": 20 },
    { "base": "fd01::/64", "size": 112 }
  ]
}

But all container networks created via action runner are always without IPv6. See your code:


      public async Task<int> DockerNetworkCreate(IExecutionContext context, string network)
        {
#if OS_WINDOWS
            return await ExecuteDockerCommandAsync(context, "network", $"create --label {DockerInstanceLabel} {network} --driver nat", context.CancellationToken);
#else
            return await ExecuteDockerCommandAsync(context, "network", $"create --label {DockerInstanceLabel} {network}", context.CancellationToken);
#endif

There is no possible way to inject --ipv6 to it.
Docker has no config flag to enable it by default

Solution add a config option to enable ipv6 on network create.

@ruben-herold ruben-herold added the bug Something isn't working label Nov 28, 2024
@ruben-herold
Copy link
Author

I build a quick and dirty work around .. not nice but working (only for documentation):

#! /bin/sh
if  [[ "${1}" == "network" ]] && [[ "${2}" == "create" ]]
  then
    /usr/bin/docker ${1} ${2} --ipv6 ${3} ${4} ${5}
  else
    /usr/bin/docker "${@}"
fi

Put this as docker in the PATH

@marko-k0
Copy link

Alternative is to trying to use host network (that is IPv6 enabled), see #3622.

@ruben-herold
Copy link
Author

@marko-k0 I know, but this can't be the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants