Search the mirror

docker search rabbitmq
Copy the code

Pull the mirror

Docker pull the rabbitmq: 3.7.18Copy the code

Run the image to get the container

docker run -d -p 15672:15672 -p 5672:5672 -v /Users/moti/Environment/RabbitMq/data:/var/lib/rabbitmq --hostname rabbit - the name the rabbitmq - restart = always the rabbitmq: 3.7.18Copy the code

Parameter interpretation

  • -dThe background
  • -pmapping15672and5672port
  • -vConfiguring a Data Volume
  • --hostnameSetting the Host Name
  • --nameContainer alias
  • --restart=alwaysThe image is automatically started when Docker is started

You can then use Docker PS to see if the container was created successfully

Enter the container and launch the Web page plug-in

docker exec -it rabbitmq /bin/bash
Copy the code
Rabbitmq-plugins enable rabbitmq_managementCopy the code

Browser access

Open a browser and access IP :15672. The default username and password are guest