安装 Docker
下载最新安装包 https://www.docker.com/ 或 下载28版本
可选 Docker Compose 下载链接
上传到Linux 文件夹 /soft
切换到文件夹
cd /soft
解压
tar -zxvf docker-28.0.2.tgz
复制到用户变量文件夹
cp docker/* /usr/bin/
新建一个service文件,用于systemctl 启动Docker
vi /etc/systemd/system/docker.service
文件内容
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
ESC wq!保存
启动Docker
systemctl daemon-reload
systemctl start docker
可选安装Docker Compose
cp docker-compose-linux-x86_64 /usr/bin/docker-compose
安装 RabbitMQ
联网环境 直接docker pull rabbitmq:4-management 带管理页面
非联网环境 下载Tar 地址 rabbitmq
上传rabbitmq 包到/soft 目录
加载到Docker image
docker load -i rabbitmq.tar
加载完成后 运行rabbitmq
docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 --privileged -v /data/mq/data:/var/lib/rabbitmq -v /data/mq/logs:/var/log/rabbitmq -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=password rabbitmq:4-management
ip + 15672 web管理页面
5672是api 端口
评论区