search

Home  >  Q&A  >  body text

docker 修改80端口

由于服务器的80端口已经运行了 web服务,而docker 运行需要80端口 所以在

docker start app
root@iZ25pamnfsuZ:/var/discourse# ./launcher start app

starting up existing container
+ /usr/bin/docker start app
Error response from daemon: Cannot start container app: Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use
Error: failed to start containers: [app]

以上错误!

改如何修改 docker的80端口呢

目前 docker images 如下

root@iZ25pamnfsuZ:/var/discourse# docker images
REPOSITORY             TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
local_discourse/app    latest              6d767d577160        4 hours ago         1.812 GB
samsaffron/discourse   1.0.12              2285ff53ab18        12 weeks ago        1.217 GB
busybox                latest              8c2e06607696        4 months ago        2.433 MB

运行如下

root@iZ25pamnfsuZ:/var/discourse# ./launcher start app

starting up existing container
+ /usr/bin/docker start app
Error response from daemon: Cannot start container app: Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use
Error: failed to start containers: [app]

前辈说 docker run -d -p 8080:80 tutum/lamp 这个解决

tutum/lamp 是指的什么呢
请输入代码

PHP中文网PHP中文网2773 days ago863

reply all(1)I'll reply

  • PHPz

    PHPz2017-04-22 08:58:23

    tutum/lamp refers to the name of your docker images. If there is no name, use IMAGE ID, 6d767d577160 <- The example is not true.

    docker run -d -p 8080:80 images/name 命令 Point 8080 to 80 in the container.

    You can access it by pointing nginx to 8080.

    reply
    0
  • Cancelreply