Foreword
docker build rabbitMQ environment
Download image
rabbitMQ Mirror warehouse address [https://hub.docker.com/_/rabbitmq][https://hub.docker.com/_/rabbitmq?tab=description]
to find the version with mangement, will take the admin interface
Download 3.8.0-management Mirror
docker pull rabbitmq:3.8.0-management
View Mirror
[root@yoyo ~]# docker images rabbitmq
REPOSITORY TAG IMAGE ID CREATED SIZE
rabbitmq 3.8.0-management 27764c8758a0 4 days ago 180MB
Start container
Start container
docker run -d --name rabbitmq3.8 -p 5672:5672 -p 15672:15672 -v
$PWD
/data:/var/lib/rabbitmq --hostname myRabbit -e RABBITMQ_DEFAULT_VHOST=my_vhost -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=admin rabbitmq:3.8.0-management
Parameter Description
- -d background container;
- --name specified container name;
- -P port specified service running (5672: application access port; 15672: Web console port numbers);
- -v map directory or file;
- --hostname host name (a RabbitMQ important considerations is that it is based on the so-called "node name" stored data, the default is the host name);
- -e specify environment variables; (RABBITMQ_DEFAULT_VHOST: default virtual machine name; RABBITMQ_DEFAULT_USER: the default user name; RABBITMQ_DEFAULT_PASS: The default password for the user name)
View containers operating status
[root@yoyo rabbitmq]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
70efaf53c9f1 rabbitmq:3.8.0-management "docker-entrypoint.s…" 4 seconds ago Up 3 seconds 4369/tcp, 5671/tcp, 0.0.0.0:5672->5672/tcp, 15671/tcp, 25672/tcp, 0.0.0.0:15672->15672/tcp rabbitmq3.8
Access the web administration interface
Enter the browser: http: // server ip: 15672 Open rabbitmq the web management interface
Enter the previously set admin account and password admin