问题原文
原帖链接 · simonszu · CC BY-SA 4.0
I have a server with several lxc containers. In some of the containers there is a docker installed. Usually a docker compose action in these LXC containers results in container names with the format appname_service_1, e.g. wordpress_app_1 and wordpress_db_1, when app and db are two services which are called in the wordpress compose file - you know it.
But today i created another LXC container and installed docker in it. The setup is identical to the other containers, thanks to ansible. However, the docker container names are different, e.g. wordpress_db_1_c9de200f9abd. The hash at the end differs whenever i delete the container and re-create it.
Since this makes containers not so disposable as they should be, because it destroys any routes between the containers, i'd like to know why this hashes are appended at all. All LXC containers have the same docker and the same docker-compose version installed. I'd like to prevent these hashes in my docker container names at all.
Why are they now occuring and didn't occur before?
社区高分解答
原帖链接 · barney765 · CC BY-SA 4.0
It's fixed in version 1.23.2:
Reverted a 1.23.0 change that appended random strings to container names created by docker-compose up, causing addressability issues. Note: Containers created by docker-compose run will continue to use randomly generated names to avoid collisions during parallel runs.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
