【发布时间】:2020-12-29 12:17:24
【问题描述】:
我正在使用 docker 构建一个 RabbitMQ 代理,并在我的 Dockerfile 中使用了官方 docker 映像 (rabbitmq:3)。
我需要启动一个脚本 (setup.sh) 来为代理设置用户和管理员。
当我执行 Dockerfile 时,
FROM rabbitmq:3
COPY provision /usr/src/provision
WORKDIR /usr/src/provision
EXPOSE 15672
EXPOSE 5672
EXPOSE 4369
RUN ./setup.sh
我明白了:
Error: unable to perform an operation on node 'rabbit@db52ce2c88d9'. Please see diagnostics information and suggestions below.
Most common reasons for this are:
* Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
* CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)
* Target node is not running
In addition to the diagnostics info below:
* See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more
* Consult server logs on node rabbit@db52ce2c88d9
* If target node is configured to use long node names, don't forget to use --longnames with CLI tools
DIAGNOSTICS
===========
attempted to contact: [rabbit@db52ce2c88d9]
rabbit@db52ce2c88d9:
* connected to epmd (port 4369) on db52ce2c88d9
* epmd reports: node 'rabbit' not running at all
no other nodes on db52ce2c88d9
* suggestion: start the node
Current node details:
* node name: 'rabbitmqcli-4810-rabbit@db52ce2c88d9'
* effective user's home directory: /var/lib/rabbitmq
* Erlang cookie hash: tql1bCPiwbtLGtuDAB3tOQ==
---------------------------------------------------------------------------
Removing intermediate container db52ce2c88d9
---> 79851f024ae3
Successfully built 79851f024ae3
Successfully tagged rmq_v0:latest
如何在删除中间容器后执行文件,但也不是docker exec 命令,它必须自动化。
谢谢:)
【问题讨论】:
标签: docker rabbitmq dockerfile