当我在Docker项目中运行Docker -compose up时,它失败了,并显示以下消息:
启动userland代理时错误:监听tcp 0.0.0.0:3000:绑定:地址已在使用
netstat -pna | grep 3000
显示了这个:
tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN -
我已经试过docker-compose down了,但没用。
当我在Docker项目中运行Docker -compose up时,它失败了,并显示以下消息:
启动userland代理时错误:监听tcp 0.0.0.0:3000:绑定:地址已在使用
netstat -pna | grep 3000
显示了这个:
tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN -
我已经试过docker-compose down了,但没用。
当前回答
改变network_mode:“bridge”到“host”。
这与
version: '2.2'
services:
bind:
image: sameersbn/bind:latest
dns: 127.0.0.1
ports:
- 172.17.42.1:53:53/udp
- 172.17.42.1:10000:10000
volumes:
- "/srv/docker/bind:/data"
environment:
- 'ROOT_PASSWORD=secret'
network_mode: "host"
其他回答
我解决了这个sudo服务redis-server停止
更改docker更新的端口比关闭其他使用端口80的服务更有意义。
For Linux / Unix:
简单搜索linux实用程序使用以下命令
netstat -nlp | grep 8888
它将显示在该端口上运行的进程,然后使用该进程的PID(在行中查找PID)杀死该进程。
kill PID
我通过重新启动Docker来解决这个问题。
当我试图启动一个新的容器时,我得到了下面的错误
监听TCP 0.0.0.0:8080: bind:地址已被使用。
查看8080端口上运行的进程:
Netstat -tulnp |握把 8080
我得到了下面的输出
[root@ip-112-x6x-2x-xxx.xxxxx.compute.internal (aws_main) ~]# netstat -tulnp | grep 8080 tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN **12749**/java [root@ip-112-x6x-2x-xxx.xxxxx.compute.internal (aws_main) ~]#
run
击杀-9 12749
然后尝试重新启动容器,它应该可以工作