如何使用Docker容器在浏览器中打开Rabbitmq? [英] How to open rabbitmq in browser using docker container?

查看:114
本文介绍了如何使用Docker容器在浏览器中打开Rabbitmq?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能已经被问到了,但是到目前为止我根本找不到任何详细的解释,而现有的文档似乎好像是为某种通灵的,应该知道的一切写的。

This was probably asked already, but so far I can't find any detailed explanation at all, and the existing documentation seems as if it was written for some kind on psychic who supposed to know everything.

根据此手册,我添加了容器

docker run -d --hostname my-rabbit --name some-rabbit rabbitmq:latest

然后我检查它以接收容器ip

Then I checked it to receive the container ip

docker inspect some-rabbit

已检查端口

docker ps

并尝试连接具有以下公式的浏览器

And tried to connect in the browser with this formula

https://{container-ip}:{port}

它没有用。

我做错了,还是我应该添加一些其他东西,例如用于存放Apache或其他东西的容器?

Am I'm doing something wrong, or maybe I am supposed to add something additional, like a container for apache or other stuff?

编辑

据我了解,在创建了一些兔子容器之后,现在我需要运行Dockerfile来创建图像? (这整个事情让我感到困惑)。我应该怎么做?我的意思是,我看到命令 docker build -f / path / to / a / Dockerfile ,但是例如,如果我将Dockerfile放在第二个路径 D中: \Docker\rabbitmq ,我应该怎么到达那里? (似乎无法识别该路径)

As I understand, after creating some-rabbit container, now I need to run Dockerfile to create image? (This whole thing is confusing to me). How am I supposed to do that? I mean, I saw command docker build -f /path/to/a/Dockerfile but if for example I placed the Dockerfile in second path D:\Docker\rabbitmq, how I supposed to get there? (the path doesn't seems to be recognized)

推荐答案

您使用的图像不正确,没有Rabbitmq_management插件已启用。将 rabbitmq:latest 更改为 rabbitmq:management

You are using the wrong image which doesn't have the rabbitmq_management plugin enabled. Change rabbitmq:latest to rabbitmq:management.

dockerhub 上,他们正在使用以下命令:

On dockerhub they are using the command:

docker run -d --hostname my-rabbit --name some-rabbit rabbitmq:3-management

如果要转到 localhost:15672 上的UI,请确保通过添加 -p 15672:15672 到以上命令。

If you want to go to the UI on localhost:15672 make sure to expose the port by adding -p 15672:15672 to the above command.

管理映像只是启用了管理插件的Rabbitmq最新映像。这是 rabbitmq:management

The management image is just the rabbitmq lattest image with the management plugin enabled. Here is the dockerfile for rabbitmq:management

FROM rabbitmq

RUN rabbitmq-plugins enable --offline rabbitmq_management

EXPOSE 15671 15672

这篇关于如何使用Docker容器在浏览器中打开Rabbitmq?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆