https://hub.docker.com/
docker search rabbitmq
官网镜像
2、拉取镜像docker pull rabbitmq
3、查看镜像>docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEmysql latest 3218b38490ce 2 months ago 516MBrabbitmq latest d445c0adc9a5 2 months ago 220MB
4、启动容器官网给的命令
https://registry.hub.docker.com/_/rabbitmq/
$ docker run -d --hostname my-rabbit --name some-rabbit rabbitmq:3
适当修改
docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 -v /rabbitmq/data:/var/lib/rabbitmq --hostname my-rabbit -e RABBITMQ_DEFAULT_VHOST=my_vhost -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=admin d445c0adc9a5
5、查看镜像>docker psConTAINER ID f97e2e6db7a1IMAGE d445c0adc9a5COMMAND docker-entrypoint.s… PORTS 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/tcpNAMES rabbitmq
进入容器
>docker exec -it f97e2e6db7a1 /bin/bashroot@my-rabbit:/#