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

查看:33
本文介绍了如何使用 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.

根据这个手册,我添加了容器

As per this manual, I added the container

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?

编辑

据我了解,在创建了 some-rabbit 容器之后,现在我需要运行 Dockerfile 来创建映像吗?(这整件事让我感到困惑).我该怎么做?我的意思是,我看到了命令 docker build -f/path/to/a/Dockerfile 但如果我将 Dockerfile 放在第二个路径 D:Docker abbitmq 中,我应该怎么去那里?(路径似乎无法识别)

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 abbitmq, 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 latest 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天全站免登陆