The EXPOSE
instruction is equivalent to docker commit -run '{"PortSpecs": ["<port>", "<port2>"]}'
. If you want to change the EXPOSE
, just run the latter at the command line (ref).
How to change container configuration without Dockerfile?
-
26-06-2023 - |
Pregunta
I'v created a Dockerfile
, with all initial configuration I needed, including EXPOSE
and CMD
instructions. Then, I've built a container and created an image from it. Then, I've started a new container from that image, and made some changes in it. Then, made a new commit and pushed my new image to the repo.
Now I want to change the image by adding new EXPOSE
instructions to it. Obviously, I don't want to start again with a Dockerfile
. How can I do it?
Solución
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow