官术网_书友最值得收藏!

Docker port mapping

In order to actually benefit from the container, we need to make it publicly accessible from the outside. This is where we will need to use the -p option with a few arguments while running the docker run command:

$ docker run -d -p 8080:80 httpd
3b1150b5034329cd9e70f90ee21531b8b1ab1d4a85141fd3a362cd40db80e193

Option -p maps container port 80 to your server port 8080. Verify that you have a httpd container exposed and a web server running:

$ curl localhost:8080
<html><body><h1>It works!</h1></body></html>
主站蜘蛛池模板: 南充市| 巴青县| 黄冈市| 盐亭县| 龙门县| 洪江市| 临颍县| 宁德市| 肃南| 社会| 平乐县| 罗源县| 宜川县| 广州市| 莫力| 千阳县| 海阳市| 军事| 台安县| 沙湾县| 丽水市| 天全县| 大安市| 龙门县| 丹巴县| 九台市| 开封市| 孝感市| 格尔木市| 五莲县| 沧源| 锦州市| 阿拉善左旗| 湘阴县| 巧家县| 蒙自县| 山阳县| 沧源| 庆阳市| 资源县| 英吉沙县|