-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compose using underscore when generating volume and network names #9618
Comments
@PAXANDDOS can you run |
PS D:\Repositories\recon> docker version
Client:
Cloud integration: v1.0.29
Version: 20.10.17
API version: 1.41
Go version: go1.17.11
Git commit: 100c701
Built: Mon Jun 6 23:09:02 2022
OS/Arch: windows/amd64
Context: default
Experimental: true
Server: Docker Desktop 4.12.0 (85629)
Engine:
Version: 20.10.17
API version: 1.41 (minimum version 1.12)
Go version: go1.17.11
Git commit: a89b842
Built: Mon Jun 6 23:01:23 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.8
GitCommit: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0
PS D:\Repositories\recon> docker compose version
Docker Compose version v2.10.2 |
Updated |
Sorry, my previous comment is incorrect. The changes that closed this issue were reverted. Relevant discussion as to why here. We're currently not planning to make changes to this behaviour due to the reasons listed in that PR. |
Using underscores in container names and services should be deprecated because it can create issues with service discovery and hostname resolution that are almost impossible to debug. Underscores are not permitted in standard DNS domain names according to RFC 1035, which only allows letters, numbers, and hyphens. Example: Docker containers fail to connect to MongoDB via Mongoose if the hostname contains underscores. |
Description
The new docker compose plugin is using underscores instead of dashes when generating volume and network names. This makes it so that half resources contain dashes in the names, and other half contain underscores.
Steps to reproduce the issue:
Use the following
docker-compose.yml
Run
docker compose -p my-test up
.Describe the results you received:
Created volume and network resources have underscore in their name:
Describe the results you expected:
I'd expect the expected names to contain only dashes, same as container name:
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker compose version
:Output of
docker info
:Is this a bug or intended behavior?
The text was updated successfully, but these errors were encountered: