docker上部署emqx

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun  安装docker的命令
systemctl enable docker.service

容器自启动

docker update --restart=always 容器名或容器ID

-----------------------------------------------------------------安装emqx--------------------------------------------------------

docker pull emqx/emqx:5.1.0
docker run -d --name emqx \
-p 1883:1883 \
-p 8081:8081 \
-p 8083:8083 \
-p 8084:8084 \
-p 8883:8883 \
-p 18083:18083 \
emqx/emqx:5.1.0
mkdir -p /home/config/emqx/{bin,etc,lib,data,log}
docker cp emqx:/opt/emqx/bin /home/config/emqx
docker cp emqx:/opt/emqx/etc /home/config/emqx
docker cp emqx:/opt/emqx/lib /home/config/emqx
docker cp emqx:/opt/emqx/data /home/config/emqx
docker cp emqx:/opt/emqx/log /home/config/emqx
chown -R 1000:1000 /home/config/emqx/
chmod -R 777 /home/config/emqx/
docker rm -f emqx
docker run -d --restart=always  --privileged=true  --name emqx \
-p 1883:1883 \
-p 8081:8081 \
-p 8083:8083 \
-p 8084:8084 \
-p 8883:8883 \
-p 18083:18083 \
-v /home/config/emqx/bin:/opt/emqx/bin \
-v /home/config/emqx/etc:/opt/emqx/etc \
-v /home/config/emqx/lib:/opt/emqx/lib \
-v /home/config/emqx/data:/opt/emqx/data \
-v /home/config/emqx/log:/opt/emqx/log \
emqx/emqx:5.1.0

你可能感兴趣的:(docker,容器)