简体   繁体   中英

How to provide container name in docker-compose.yml?

我想将容器名称添加到docker-compose.yml中,以便我的容器不会获得随机生成的名称。

Add container_name attribute to your docker-compose.yml file so it becomes:

container_name: my_fancy_container_name

More info here https://docs.docker.com/compose/compose-file/#container_name

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM