Docker在运行RabbitMQ时出错

时间:2018-10-21 09:42:32

标签: docker docker-compose

我有一个问题,就是Docker在RabbitMQ中给出了异常并且没有运行项目。像前两天一样工作正常

错误代码:

Severity    Code    Description Project File    Line    Source  Suppression State
Error       The DOCKER_REGISTRY variable is not set. Defaulting to a blank string.
Creating network "dockercompose17804906324906542053_default" with the default driver
Building syncserviceexchange
Building webapisyncserviceexchange
Creating dockercompose17804906324906542053_rabbit2_1 ... 
Creating elasticsearch                               ... 
Creating mysql1                                      ... 
Creating myadmin                                     ... 
Creating dockercompose17804906324906542053_rabbit2_1 ... error
ERROR: for dockercompose17804906324906542053_rabbit2_1  Cannot start service rabbit2: driver failed programming external connectivity on endpoint dockercompose17804906324906542053_rabbit2_1 (5ff7c5b4d0fa9db5bc8b35dc4010c306c0e357a97d1ea912bd9b290fdfa6f8fd): Error starting userland proxy: Bind for 0.0.0.0:5672 failed: port is already allocated
Creating mysql1                                      ... error
ERROR: for mysql1  Cannot start service db: error while creating mount source path '/host_mnt/g/Flexfone/Imp&Rec/Flexfone/SyncServiceExchange/datadir': mkdir /host_mnt/g: file exists
Creating elasticsearch                               ... done
Creating myadmin                                     ... done
ERROR: for rabbit2  Cannot start service rabbit2: driver failed programming external connectivity on endpoint dockercompose17804906324906542053_rabbit2_1 (5ff7c5b4d0fa9db5bc8b35dc4010c306c0e357a97d1ea912bd9b290fdfa6f8fd): Error starting userland proxy: Bind for 0.0.0.0:5672 failed: port is already allocated
ERROR: for db  Cannot start service db: error while creating mount source path '/host_mnt/g/Flexfone/Imp&Rec/Flexfone/SyncServiceExchange/datadir': mkdir /host_mnt/g: file exists
Encountered errors while bringing up the project..  

VS Image

1 个答案:

答案 0 :(得分:2)

表示已使用的端口,您必须先停止上一个容器:

  

绑定0.0.0.0:5672失败:端口已分配

如果使用docker-compose,则可以使用docker-compose down,它也会停止该组合中的所有服务

使用docker stop <container_name>停止特定的容器 如果更新了映像,请先将其删除,然后重建映像并重新运行容器,请进行必要的清理,但在这种情况下,您必须运行它并在命令行中对其进行手动配置。

要查看正在运行哪些docker容器,请检查docker ps ..如果未在该端口使用该端口,则该计算机操作系统中的另一个进程将其检查了