I have an existing network namespace:
dewi@dewiserver:~$ ip netns list
dewinetns235 (id: 0)
How can I get a docker container to use and run inside this network namespace?
e.g. run something like
docker run --rm curlimages/curl:7.81.0 --namespace dewinetns235 -L -v https://curl.haxx.se
So in this instance I want the curl command to exist within the dewinetns235 network namespace
Many thanks
A quick google turns up this link. Looks like you attach the network namespace after running the container? I'm a bit surprised this isn't more built-in to Docker.
There is the
--network
flag todocker run
but I suspect that's for Docker-created networks.