docker安装rabbitMQ

docker安装rabbitMq

首先安装docker

如果安装有docker卸载之前的docker

#先删除yumdocker
yum remove docker
#删除文件
yum remove docker-*

安装docker

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

执行docker查询版本号命令

docker -v
# 返回 Docker version 24.0.6, build ed223bc

运行docker

service docker start

查询docker rabbitmq

docker search rabbitmq

返回以下内容

NAME                                      DESCRIPTION                                      STARS     OFFICIAL   AUTOMATED
rabbitmq                                  RabbitMQ is an open source multi-protocol me…   4891      [OK]       
bitnami/rabbitmq                          Bitnami Docker Image for RabbitMQ                103                  [OK]
circleci/rabbitmq-delayed                 https://github.com/circleci/rabbitmq-delayed…   1                    
circleci/rabbitmq                         This image is for internal use                   0                    
bitnami/rabbitmq-cluster-operator                                                          1                    
rapidfort/rabbitmq                        RapidFort optimized, hardened image for Rabb…   9                    
bitnamicharts/rabbitmq                                                                     2                    
bitnamicharts/rabbitmq-cluster-operator                                                    0                    
elestio/rabbitmq                          Rabbitmq, verified and packaged by Elestio       0                    
masstransit/rabbitmq                      Contains the RabbitMQ management Docker imag…   12                   
itisfoundation/rabbitmq                                                                    0                    
nasqueron/rabbitmqadmin                   RabbitMQ management plugin CLI tool Lightwei…   1                    [OK]
clearlinux/rabbitmq                       RabbitMQ multi-protocol messaging broker wit…   0                    
itzg/rabbitmq-stomp                       Extension of the official rabbitmq image tha…   0                    [OK]
corpusops/rabbitmq                        https://github.com/corpusops/docker-images/      0                    
brightercommand/rabbitmq                  RabbitMQ management with delay plugin enabled    0                    
drud/rabbitmq                             rabbitmq                                         0                    [OK]
nasqueron/rabbitmq                        RabbitMQ wth management, MQTT and STOMP plug…   0                    [OK]
exozet/rabbitmq-delay-management          deprecated                                       1                    
uselagoon/rabbitmq                                                                         0                    
betterweb/rabbitmq                                                                         0                    
newrelic/k8s-nri-rabbitmq                 New Relic Infrastructure RabbitMQ Integratio…   0                    
uselagoon/rabbitmq-cluster                                                                 0                    
betterweb/rabbitmq-swarm-cluster          https://gitlab.com/BetterCorp/public/rabbitm…   0                    
faucet/event-adapter-rabbitmq              Faucet rabbitmq event adaptor docker image …   0     

我们使用第一个,进行拉取

docker pull rabbitmq:3.12-management

查看镜像

docker images

返回如下

REPOSITORY   TAG               IMAGE ID       CREATED        SIZE
rabbitmq     latest            bf93b07bd808   5 days ago     217MB
rabbitmq     3.12-management   d01999da73ff   3 months ago   246MB

启动

docker run --name rabbitmq --restart=always -p 5672:5672 -p 15672:15672  -d rabbitmq:3.12-management

查看端口

lsof -i:15672
# 如果没有lsof 请使用yum install lsof 下载,要使用root

返回如下

COMMAND     PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
docker-pr 15179 root    4u  IPv4 117187      0t0  TCP *:amqp (LISTEN)
docker-pr 15184 root    4u  IPv6 117192      0t0  TCP *:amqp (LISTEN)

查看已经允许的镜像

docker ps -a

返回如下

CONTAINER ID   IMAGE                      COMMAND                   CREATED         STATUS         PORTS                                                                                                                                                 NAMES
14ff787bcd41   rabbitmq:3.12-management   "docker-entrypoint.s…"   4 minutes ago   Up 4 minutes   4369/tcp, 5671/tcp, 0.0.0.0:5672->5672/tcp, :::5672->5672/tcp, 15671/tcp, 15691-15692/tcp, 25672/tcp, 0.0.0.0:15672->15672/tcp, :::15672->15672/tcp   some-rabbitmq
07-22 834
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值