I use the following docker-compose.yml to start a container,
- subnet: "10.0.2.0/24"
I think the network name should be “nacos_net”, but it is temp_nacos_net, what is wrong and how to fix this?
# docker network ls
NETWORK ID NAME DRIVER SCOPE
4e2323469ed0 temp_nacos_net bridge local
May I suggest to spend some time with online trainings to build up a basic understanding on Docker and Swarm?
– docker self paced training
– swarm self paced training
Is there any chance that ‘temp’ is the name of the folder that contains the ‘docker-compose.yml’?
yes, you are right, it is, how to remove it?
As far as I know these is the common behavior of docker-compose; It use the parent folder name as “context/prefix” for all the resources it’s controls.
I’m sure that if you run ‘docker ps -a’, the ‘nacos1’ container is named ‘temp_nacos1’.
In the case of the network, if you really need use another name, You can create it with ‘docker network create’; and then reference it in the ‘docker-compose’ as “external”.