docker pull nacos/nacos-server
将容器中的配置文件拷贝到本地
mkdir -p /home/server/nacos/logs
cd /home/server/nacos
docker run -id --name nacos -p 8848:8848 nacos/nacos-server:latest
docker cp nacos:/home/nacos/conf ./
docker stop nacos && docker rm nacos
docker run -id --name nacos \
-e PREFER_HOST_MODE=192.168.20.113 \
-e MODE=standalone \
-e SPRING_DATASOURCE_PLATFORM=mysql \
-e MYSQL_SERVICE_HOST=192.168.20.113 \
-e MYSQL_SERVICE_PORT=3316 \
-e MYSQL_SERVICE_DB_NAME=nacos \
-e MYSQL_SERVICE_USER=root \
-e MYSQL_SERVICE_PASSWORD=123456 \
-v /home/server/nacos/conf:/home/nacos/conf \
-v /home/server/nacos/logs:/home/nacos/logs \
-p 8848:8848 \
--restart=always \
docker.io/nacos/nacos-server:latest