Docker: How to Install Nacos

1. Create a local map file

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
mkdir -p /root/nacos/init.d /root/nacos/logs
mkdir -p /root/nacos/init.d /root/nacos/logs
mkdir -p /root/nacos/init.d /root/nacos/logs
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
touch /root/nacos/init.d/custom.properties
touch /root/nacos/init.d/custom.properties
touch /root/nacos/init.d/custom.properties

 

2. write configuration in file

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
management.endpoints.web.exposure.include=*
management.endpoints.web.exposure.include=*
management.endpoints.web.exposure.include=*

 

3. configure startup

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
docker run -d -p 8848:8848 -e MODE=standalone -e PREFER_HOST_MODE=hostname -v /home/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties -v /home/nacos/logs:/home/nacos/logs --restart always --name nacos nacos/nacos-server
docker run -d -p 8848:8848 -e MODE=standalone -e PREFER_HOST_MODE=hostname -v /home/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties -v /home/nacos/logs:/home/nacos/logs --restart always --name nacos nacos/nacos-server
docker run -d -p 8848:8848 -e MODE=standalone -e PREFER_HOST_MODE=hostname -v /home/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties -v /home/nacos/logs:/home/nacos/logs --restart always --name nacos nacos/nacos-server

Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *