You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Restart the container every time , hostname is always overwritten by container id in container when using --network=host,but the hostname in the container will change at any time, after restarting the container it changes to the container id AGAIN!
Steps to reproduce the issue
1.nerdctl run --network=host -v /etc/resolv.conf:/etc/resolv.conf -v /etc/hosts:/etc/hosts -v /etc/hostname:/etc/hostname --privileged=true images:v1.0.0 --name=test
2.nerdctl exec -it test bash
3.hostname : it shows container id a7e60e651786
4.echo 'myhost' > /etc/hostname && hostname 'myhost'
5.restart the container
6.nerdctl exec -it test bash
7.hostname: it shows container id a7e60e651786 AGAIN! not named 'myhost'
Describe the results you received and expected
hostname : it shows myhost
What version of nerdctl are you using?
1.7.0
Are you using a variant of nerdctl? (e.g., Rancher Desktop)
None
Host information
No response
The text was updated successfully, but these errors were encountered:
Description
Restart the container every time ,
hostname
is always overwritten by container id in container when using --network=host,but the hostname in the container will change at any time, after restarting the container it changes to the container id AGAIN!Steps to reproduce the issue
1.
nerdctl run --network=host -v /etc/resolv.conf:/etc/resolv.conf -v /etc/hosts:/etc/hosts -v /etc/hostname:/etc/hostname --privileged=true images:v1.0.0 --name=test
2.
nerdctl exec -it test bash
3.
hostname
: it shows container ida7e60e651786
4.
echo 'myhost' > /etc/hostname && hostname 'myhost'
5.restart the container
6.
nerdctl exec -it test bash
7.
hostname
: it shows container ida7e60e651786
AGAIN! not named 'myhost'Describe the results you received and expected
hostname : it shows
myhost
What version of nerdctl are you using?
1.7.0
Are you using a variant of nerdctl? (e.g., Rancher Desktop)
None
Host information
No response
The text was updated successfully, but these errors were encountered: