docker 安装 nacos2.0.3
docker pul1 nacos/nacos-server:v2.0.3
mkdir -p /opt/nacos/init.d
mkdir -p /opt/nacos/logs
cd /opt/nacos/init.d
touch custom.properties
在custom.properties文件中填写如下配置:更改你的数据库配置信息
management.endpoints.web.exposure.include=*`
spring.datasource.platform=mysql
db.num=1
db.url.0=jdbc:mysql://127.0.0.1:3306/nacos_config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
db.user=root
db.password=1639798869aaa
docker run -d \
-v /opt/nacos/logs:/home/nacos/logs \
-v /opt/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties \
-e PREFER_HOST_MODE=hostname \
-e MODE=standalone \
-p 8848:8848 \
-p 9848:9848 \
-p 9849:9849 \
--name nacos \
--restart=always \
nacos/nacos-server:2.0.3
本文来自博客园,作者:冰莫莫,转载请注明原文链接:https://www.cnblogs.com/icemomo/p/17872662.html