3

How do I open up a new port in a docker container running in Docker for Windows? The container is already created with a different list of exposed ports, I want to keep the old ports and add a new port.

There is already a question about this for Linux, here: How do I assign a port mapping to an existing Docker container?

But for Docker for Windows the configuration files are different (or missing) so that answer does not apply here.

Docker Version 18.03.1-ce-win65 (17513)

  • I’m almost positive that the exact same answers in the question you linked apply to both Windows and Linux. Fundamentally you have to delete the container and `docker run` a new one. (And go with the later answer recommending making it easy to `docker rm` containers without losing data; IMHO `docker commit` isn’t a good habit to be in.) – David Maze Jul 31 '18 at 15:17
  • @DavidMaze: I am not interested in that solution. I want to keep my old container, and edit its ports, like we do in Linux in this file: /var/lib/docker/containers/[hash_of_the_container]/hostconfig.json. But apparently that file is not present in Windows (see holdfenytolvaj' answer). – Liviu Gheorghisan Jul 31 '18 at 15:20

0 Answers0