nerdctl icon indicating copy to clipboard operation
nerdctl copied to clipboard

Parameter --add-host not working when using also --net=host

Open czqrny opened this issue 1 year ago • 2 comments

Description

When I run container using nerdctl run ... the parameter --add-host is not working when I also use --net host parametr. This seems to be strange because the same is working well on docker.

Steps to reproduce the issue

  1. run nerdctl run --rm --add-host=dakfgashfaohsfashfoasfno:2.1.3.7 --net=host ubuntu getent hosts dakfgashfaohsfashfoasfno
  2. run nerdctl run --rm --add-host=dakfgashfaohsfashfoasfno:2.1.3.7 ubuntu getent hosts dakfgashfaohsfashfoasfno
  3. compare results

Describe the results you received and expected

First command is giving no output, second one gives an entry defined by --add-host parameter. I expect that both commands gives the same results.

What version of nerdctl are you using?

1.6.2 installed in rootles mode, but I discoverd it on one of my hosts with version 1.4.0.

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

Host information

Virtual machine on OpenStack cloud, running on Ubuntu-focal.

czqrny avatar Oct 31 '23 21:10 czqrny

Is this a duplicate of:

  • https://github.com/containerd/nerdctl/issues/2591

?

AkihiroSuda avatar Dec 04 '23 08:12 AkihiroSuda

link to https://github.com/moby/moby/pull/22408

yankay avatar Dec 06 '23 08:12 yankay