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?

¿Fue útil?

Solución

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).

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top