Linux服务器docker安装mqtt服务
参考:
linux安装docker以及配置docker镜像(完整详细版)
docker卸载
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine \
docker-ce
安装yum
yum install -y yum-utils device-mapper-persistent-data lvm2
配置docker存储库
中央仓库: yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
阿里仓库: yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
安装docker
yum install -y docker-ce docker-ce-cli containerd.io
配置镜像
# 打开 Docker 配置文件
vim /etc/docker/daemon.json
# 添加国内镜像源
{
"registry-mirrors": [
"https://registry.docker-cn.com",
"https://docker.mirrors.ustc.edu.cn",
"https://hub-mirror.c.163.com",
"https://hub.uuuadc.top",
"https://docker.anyhub.us.kg",
"https://dockerhub.jobcher.com",
"https://dockerhub.icu",
"https://docker.ckyl.me",
"https://docker.awsl9527.cn",
"https://mirror.baidubce.com"
]
}
# 重启 Docker 服务
sudo systemctl daemon-reload
sudo systemctl restart docker
安装mqtt