What is the difference between “expose” and “publish” in Docker?

后端 未结 6 1229

I\'m experimenting with Dockerfiles, and I think I understand most of the logic. However, I don\'t see the difference between \"exposing\" and \"publishing\" a port in this

6条回答
  •  孤独总比滥情好
    2020-11-22 06:04

    EXPOSE is used to map local port container port ie : if you specify expose in docker file like

    EXPOSE 8090

    What will does it will map localhost port 8090 to container port 8090

提交回复
热议问题