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

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>
主站蜘蛛池模板: 鄂温| 宜黄县| 永新县| 鄂伦春自治旗| 英吉沙县| 都江堰市| 洪湖市| 津市市| 河东区| 定西市| 岑溪市| 繁峙县| 靖安县| 松滋市| 永昌县| 治多县| 嘉黎县| 上饶市| 丰县| 凤山市| 梁河县| 岳阳市| 鹤壁市| 灌云县| 丰台区| 巫山县| 石林| 长沙市| 江华| 威宁| 平陆县| 南安市| 富川| 赞皇县| 福鼎市| 松江区| 孟津县| 上高县| 霍州市| 萨迦县| 武宣县|