Want to mapping port on running docker. has no priviledge, how to add priviledge on running docker? Some of container depending on a container, now the container need mapping port.if rerun, all of the container must be recreated. it will be very pain.
We need a lot more info to answer your question. What OS are you using? What version of Docker? What installation method did you use? You can always stop your container and restart it (without recreating it) and use the -p flag. Port-mapping is a runtime concern and ports are always allocated when the container starts, not when it is created.
On macOS, docker version 17.06.2-ce.
Is there command like
"docker update add-cap NET_WORK container_id"
"docker start|update -p port:port container_id"
You can use the following flags on docker run:
--cap-add list Add Linux capabilities
--cap-drop list Drop Linux capabilities
For instance, I stop a running container and then restart it with the NET_ADMIN capability:
docker container stop mytest
docker run --cap-add NET_ADMIN mytest
For more info about capabilities, you can look at the man page for capabilities. Since you're on a Mac, it may be easiest to view it online.
@mstanleyjones
Are you sure use "docker run --cap-add NET_ADMIN mytest"
docker run will get "mytest" image, but no make some change and start "mytest"
excute display follow:
unable to find image 'some-mysql:latest' locally
Please check..