1. 下载镜像
root@reqq:/home/docker/rabbit# docker pull rabbitmq
Using default tag: latest
latest: Pulling from library/rabbitmq
846c0b181fff: Already exists
03dea6b5e70e: Pull complete
cae1c228689d: Pull complete
3ddf939b4464: Pull complete
92e035229b11: Pull complete
c07a0c5fb44c: Pull complete
34bc881cb21a: Pull complete
c17f64449390: Pull complete
dd3bdcc0ac44: Pull complete
2fa407913eb6: Pull complete
Digest: sha256:90e20c3d3dfc1a50a92ada5fceb45155c448dc95c28e8fa907912beb8e79ce0a
Status: Downloaded newer image for rabbitmq:latest
docker.io/library/rabbitmq:latest
root@reqq:/home/docker/rabbit# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
rabbitmq latest 3ddcc140fe5c 56 minutes ago 228MB
redis latest 83a5aeccc5e0 2 days ago 117MB
mongo latest 0850fead9327 6 days ago 700MB
mysql latest 7484689f290f 8 days ago 538MB
registry latest 3a0f7b0a13ef 4 months ago 24.1MB
postgres 14 e09e90144645 4 months ago 376MB
gitea/gitea 1.17.0 71d4bdcd6398 4 months ago 247MB
lxdware/dashboard latest cc0dea6869b6 8 months ago 329MB
localhost:5000/epicgames/unreal-engine dev-4.27.2 88e044df7401 12 months ago 36.1GB
2. 通过启动配置rabbitmq的用户名和密码
root@reqq:/home/docker/rabbit# docker run -d -p 15672:15672 -p 5672:5672 -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=hett --name rabbitmq --hostname=rabbitmqhostone rabbitmq
922bf268406ba01c21c244819ddef6274d20d89f90faebc0776ec73940ef2ded
root@reqq:/home/docker/rabbit# docke rps
Command 'docke' not found, did you mean:
command 'docker' from deb docker.io (20.10.12-0ubuntu2~20.04.1)
Try: apt install <deb name>
root@reqq:/home/docker/rabbit# docker rps
docker: 'rps' is not a docker command.
See 'docker --help'
root@reqq:/home/docker/rabbit# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
922bf268406b rabbitmq "docker-entrypoint.s…" 19 seconds ago Up 18 seconds 4369/tcp, 0.0.0.0:5672->5672/tcp, :::5672->5672/tcp, 5671/tcp, 15691-15692/tcp, 25672/tcp, 0.0.0.0:15672->15672/tcp, :::15672->15672/tcp rabbitmq
03e531b5d068 mysql "docker-entrypoint.s…" 53 minutes ago Up 53 minutes 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp mysql
0492f4f01b10 redis "docker-entrypoint.s…" 2 hours ago Up 5 minutes 0.0.0.0:6379->6379/tcp, :::6379->6379/tcp redis
dd6a1a3d3b9f mongo "docker-entrypoint.s…" 2 hours ago Up 2 hours 0.0.0.0:27017->27017/tcp, :::27017->27017/tcp mongo
41dfab6ece8f lxdware/dashboard:latest "/bin/sh -c /root/st…" 3 months ago Up 4 weeks 0.0.0.0:1081->80/tcp, :::1081->80/tcp lxd-dashboard-test
b2b0e8c2cf94 registry:latest "/entrypoint.sh /etc…" 3 months ago Up 4 weeks 0.0.0.0:5000->5000/tcp, :::5000->5000/tcp registry
dccda8218b12 lxdware/dashboard:latest "/bin/sh -c /root/st…" 4 months ago Up 9 days 0.0.0.0:1080->80/tcp, :::1080->80/tcp lxd-dashboard
fbee26c03e1e gitea/gitea:1.17.0 "/usr/bin/entrypoint…" 4 months ago Up 4 weeks 0.0.0.0:22->22/tcp, :::22->22/tcp, 0.0.0.0:80->3000/tcp, :::80->3000/tcp gitea
ae747cd15e60 postgres:14 "docker-entrypoint.s…" 4 months ago Up 4 weeks 5432/tcp gitea-db-1
root@reqq:/home/docker/rabbit# netstat -antp | grep 15672
tcp 0 0 0.0.0.0:15672 0.0.0.0:* LISTEN 3704425/docker-prox
tcp6 0 0 :::15672 :::* LISTEN 3704438/docker-prox
root@reqq:/home/docker/rabbit# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
922bf268406b rabbitmq "docker-entrypoint.s…" 4 minutes ago Up 4 minutes 4369/tcp, 0.0.0.0:5672->5672/tcp, :::5672->5672/tcp, 5671/tcp, 15691-15692/tcp, 25672/tcp, 0.0.0.0:15672->15672/tcp, :::15672->15672/tcp rabbitmq
03e531b5d068 mysql "docker-entrypoint.s…" 57 minutes ago Up 57 minutes 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp mysql
0492f4f01b10 redis "docker-entrypoint.s…" 2 hours ago Up 9 minutes 0.0.0.0:6379->6379/tcp, :::6379->6379/tcp redis
dd6a1a3d3b9f mongo "docker-entrypoint.s…" 2 hours ago Up 2 hours 0.0.0.0:27017->27017/tcp, :::27017->27017/tcp mongo
41dfab6ece8f lxdware/dashboard:latest "/bin/sh -c /root/st…" 3 months ago Up 4 weeks 0.0.0.0:1081->80/tcp, :::1081->80/tcp lxd-dashboard-test
b2b0e8c2cf94 registry:latest "/entrypoint.sh /etc…" 3 months ago Up 4 weeks 0.0.0.0:5000->5000/tcp, :::5000->5000/tcp registry
dccda8218b12 lxdware/dashboard:latest "/bin/sh -c /root/st…" 4 months ago Up 9 days 0.0.0.0:1080->80/tcp, :::1080->80/tcp lxd-dashboard
fbee26c03e1e gitea/gitea:1.17.0 "/usr/bin/entrypoint…" 4 months ago Up 4 weeks 0.0.0.0:22->22/tcp, :::22->22/tcp, 0.0.0.0:80->3000/tcp, :::80->3000/tcp gitea
ae747cd15e60 postgres:14 "docker-entrypoint.s…" 4 months ago Up 4 weeks 5432/tcp gitea-db-1
3. 如果此时通过浏览器打开的时候无法打开主页,需要启动一个插件:
root@reqq:/home/docker/rabbit# docker exec -it rabbitmq bash
root@rabbitmqhostone:/# rabbitmq-plugins enable rabbitmq_management
Enabling plugins on node rabbit@rabbitmqhostone:
rabbitmq_management
The following plugins have been configured:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_prometheus
rabbitmq_web_dispatch
Applying plugin configuration to rabbit@rabbitmqhostone...
The following plugins have been enabled:
rabbitmq_management
started 1 plugins.
root@rabbitmqhostone:/# exit
exit
root@reqq:/home/docker/rabbit# cd
4. 可以正常访问 http://192.168.30.64:15672/#/访问的地址
标签:ago,0.0,Up,tcp,rabbitmq,rabbit,docker,安装 From: https://www.cnblogs.com/youran-he/p/16984493.html