1、创建相应的文件夹配置文件,启动:
[root@localhost ~]# cd /opt
[root@localhost opt]# mkdir docker_rabbitmq
[root@localhost opt]# cd docker_rabbitmq/
[root@localhost docker_rabbitmq]# vi docker-compose.yml
[root@localhost docker_rabbitmq]# docker-compose up -d
Creating rabbitmq ... done
2、docker-compose.yml配置文件
version: "3.1"
services:
rabbitmq:
image: daocloud.io/library/rabbitmq:management
restart: always
container_name: rabbitmq
ports:
- 5672:5672
- 15672:15672
volumes:
- ./data:/var/lib/rabbitmq
登录管理页面,用户名和密码默认都是guest,登录成功,看到管理界面的样子