vi /etc/apt/sources.list
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricteddeb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-propertiesdeb http://mirrors.aliyun.com/ubuntu/ xenial main restricteddeb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-propertiesdeb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricteddeb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-propertiesdeb http://mirrors.aliyun.com/ubuntu/ xenial universedeb http://mirrors.aliyun.com/ubuntu/ xenial-updates universedeb http://mirrors.aliyun.com/ubuntu/ xenial multiversedeb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiversedeb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-propertiesdeb http://archive.canonical.com/ubuntu xenial partnerdeb-src http://archive.canonical.com/ubuntu xenial partnerdeb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricteddeb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-propertiesdeb http://mirrors.aliyun.com/ubuntu/ xenial-security universedeb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu xenial stabledeb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
apt-get update
docker search rabbitmq

docker pull rabbitmq #(镜像未配有控制台)docker pull rabbitmq:management #(镜像配有控制台)#注意:rabbitmq是官方镜像,该镜像不带控制台。如果要安装带控制台的镜像,需要在拉取镜像时附带tag标签,例如:management。tag标签可以通过https://hub.docker.com/_/rabbitmq?tab=tags来查询。#执行docker pull rabbitmq:management

docker run --name rabbitmq -d -p 15672:15672 -p 5672:5672 rabbitmq:management
#启动 RabbitMQ 容器docker start rabbitmq#停止 RabbitMQ 容器docker stop rabbitmq#重启 RabbitMQ 容器docker restart rabbitmq#查看 RabbitMQ 容器进程信息docker top rabbitmq#控制台信息#启动容器后,可以浏览器中访问http://localhost:15672来查看控制台信息。#RabbitMQ默认的用户名:guest,密码:guest
#docker stop [CONTAINER ID] 失败,导致 docker rm [CONTAINER ID] 失败docker rm -f [CONTAINER ID] //强制删除#再次创建容器但是报错,网络节点被占用#docker: Error response from daemon: endpoint with name rabbitmq already exists in network bridge.ps -ef | grep rabbitmqdocker network disconnect --force bridge [rabbitmq 节点名称]
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号