一、获取镜像

#指定版本,该版本包含了web控制页面
docker pull rabbitmq:management

二、运行镜像

#方式一:默认guest 用户,密码也是 guest
docker run -d --hostname my-rabbit --name rabbit -p 15672:15672 -p 5672:5672 rabbitmq:management

#方式二:设置用户名和密码
docker run -d --hostname my-rabbit --name rabbit -e RABBITMQ_DEFAULT_USER=user -e RABBITMQ_DEFAULT_PASS=password -p 15672:15672 -p 5672:5672 rabbitmq:management

  整个流程:

[root@in ~]# docker pull rabbitmq:management
management: Pulling from library/rabbitmq
5bed26d33875: Pull complete
f11b29a9c730: Pull complete
930bda195c84: Pull complete
78bf9a5ad49e: Pull complete
0719cf990071: Pull complete
5903eba3f9ed: Pull complete
110bda0253c5: Pull complete
c5cf7d5b7823: Pull complete
3d32b3fae767: Pull complete
cb893d28ba27: Pull complete
20445c8abae2: Pull complete
f53c8e34c71b: Pull complete
Digest: sha256:7169775390e571dcdd9bd47aeabc8891ebb6859221a36e55566a6442c586d768
Status: Downloaded newer image for rabbitmq:management
docker.io/library/rabbitmq:management
[root@in ~]#
[root@in ~]#
[root@in ~]#
[root@in ~]# docker run -d --hostname my-rabbit --name rabbit -p 15672:15672 -p 5672:5672 rabbitmq:management
3d3b98f1362164e09baaddbebb7a628666a2c822988c5616413df7b16c40a11d
[root@instance-dsusu6ck ~]#

三、访问ui页面

http://localhost:15672/

 

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐