Docker 部署 MQTT
96人浏览 / 0人评论
部署
docker pull emqx/emqx:5.8
docker run -d --name mqtt --privileged=true -p 1883:1883 -p 8883:8883 -p 8083:8083 -p 8084:8084 -p 8081:8081 -p 18083:18083 emqx/emqx:5.8
mkdir -p /usr/local/src/mqtt/etc /usr/local/src/mqtt/lib /usr/local/src/mqtt/data /usr/local/src/mqtt/log
# 复制文件
## linux
docker cp mqtt:/opt/emqx/etc /usr/local/src/mqtt
docker cp mqtt:/opt/emqx/data /usr/local/src/mqtt
docker cp mqtt:/opt/emqx/log /usr/local/src/mqtt
docker cp mqtt:/opt/emqx/lib /usr/local/src/mqtt
## windows
docker cp mqtt:/opt/emqx/etc D:\Docker\emqx
docker cp mqtt:/opt/emqx/data D:\Docker\emqx
docker cp mqtt:/opt/emqx/log D:\Docker\emqx
docker cp mqtt:/opt/emqx/lib D:\Docker\emqx
docker rm -f mqtt
docker run -d --restart=always --name mqtt -p 1883:1883 -p 8883:8883 -p 8083:8083 -p 8084:8084 -p 8081:8081 -p 18083:18083 -v D:\Docker\emqx\etc:/opt/emqx/etc -v D:\Docker\emqx\data:/opt/emqx/data -v D:\Docker\emqx\log:/opt/emqx/log -v D:\Docker\emqx\lib:/opt/emqx/lib emqx/emqx:5.8
默认账号:admin
默认密码:public
全部评论