== Nacos 2
=== 安装
[source,bash]
----
# 获取镜像
docker pull nacos/nacos-server:v2.1.2-slim

# 创建并启动容器,并将容器加入到 wspsc 桥接网络中
docker run \
    --name nacos \
    --network=wspsc \
    -d \
    -p 8848:8848 \
    -p 9848:9848 \
    -p 9849:9849 \
    -e MODE=standalone \
    -e SPRING_DATASOURCE_PLATFORM=mysql \
    -e MYSQL_SERVICE_HOST=mysql8 \
    -e MYSQL_SERVICE_PORT=3306 \
    -e MYSQL_SERVICE_USER=nacos \
    -e MYSQL_SERVICE_PASSWORD=nacos \
    -e MYSQL_SERVICE_DB_NAME=nacos \
    -e TIME_ZONE='Asia/Shanghai' \
    nacos/nacos-server:v2.1.2-slim

# 复制容器中的配置
docker cp -a nacos:/home/nacos/conf /Users/wangshaoping/wspsc/software/docker/volume/nacos_v2.1.2/conf
docker cp -a nacos:/home/nacos/logs /Users/wangshaoping/wspsc/software/docker/volume/nacos_v2.1.2/logs
docker cp -a nacos:/home/nacos/data /Users/wangshaoping/wspsc/software/docker/volume/nacos_v2.1.2/data

# 停止容器
docker stop nacos

# 删除容器
docker container rm nacos

# 重启容器，并带上 -v 参数
docker run \
    --name nacos \
    --network=wspsc \
    -d \
    -p 8848:8848 \
    -p 9848:9848 \
    -p 9849:9849 \
    -v /Users/wangshaoping/wspsc/software/docker/volume/nacos_v2.1.2/conf:/home/nacos/conf \
    -v /Users/wangshaoping/wspsc/software/docker/volume/nacos_v2.1.2/logs:/home/nacos/logs \
    -v /Users/wangshaoping/wspsc/software/docker/volume/nacos_v2.1.2/data:/home/nacos/data \
    -e MODE=standalone \
    -e SPRING_DATASOURCE_PLATFORM=mysql \
    -e MYSQL_SERVICE_HOST=mysql8 \
    -e MYSQL_SERVICE_PORT=3306 \
    -e MYSQL_SERVICE_USER=nacos \
    -e MYSQL_SERVICE_PASSWORD=nacos \
    -e MYSQL_SERVICE_DB_NAME=nacos \
    -e TIME_ZONE='Asia/Shanghai' \
    nacos/nacos-server:v2.1.2-slim
----

=== 使用
[source,bash]
----

----

