How to do it...

Perform the following steps:

  1. To share the host network namespace with the container, run the following command:
        $ docker container run -it --net=host alpine ash

If you see the network details inside the container, run the following command:

        $ ip a

You will see a result the same as the host:

  1. To share the host network, PID, and IPC namespaces with the container, run the following command:
         $ docker container run -it --net=host --pid=host --ipc=host alpine ash

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.36.32