-
Notifications
You must be signed in to change notification settings - Fork 254
"network default: network.external.name is deprecated in favor of network.name" #1856
Comments
I was not able to reproduce this issue tested with: services:
test:
image: nginx
networks:
default:
name: ddev_default
external: true $ docker-compose compose up
[+] Running 1/1
⠿ Container truc_test_1 Started 2.0s
Attaching to test_1
test_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
... Can you please prepare a minimal reproduction example? |
for your information, at some point compose file syntax we defined as:
This was error prone and has been redesign to let user adopt the current syntax, passing I notice you use |
see https://github.com/drud/ddev/blob/master/pkg/ddevapp/templates.go#L190-L193 please report issue to ddev maintainers |
I am the maintainer of ddev, trying to get it to work with new compose v2 :) I'm sorry, I'm still missing the point I guess. The docs clearly show the syntax ddev is using here, don't they? https://docs.docker.com/compose/networking/#use-a-pre-existing-network Am I just blind and I can't see the difference? Can you propose the correct format? You can recreate this just by using ddev with compose v2: mkdir junk
ddev config --auto
ddev start |
Oh, nice. reference syntax: networks:
default:
external: true
name: my-pre-existing-network ddev template: networks:
default:
external:
name: ddev_default shoud be: networks:
default:
name: ddev_default
external: true Makes me wonder: as ddev is written in Go, maybe you could use compose-go to build the model and marshall into yaml? |
What is compose-go? Would love to know more. Here's the fix for ddev, ddev/ddev#3076 The reason I couldn't see it is that ddev uses |
you could do something similar to https://github.com/docker/compose-cli/blob/32fccdda30afa45cd6aab8641ed838a5549573ea/cmd/compose/compose.go#L157-L185 if you don't want to rely on |
Ugh. What is the correct syntax?? |
The docs still look incorrect.
Correct syntax:
or
|
I agree with others. The documentation needs to be updated to reflect the correct syntax. Please either reopen this issue or create a new one for that purpose. |
Pre-existing networks (defined elsewhere) are marked as `external` in `docker-compose.yml`. Instead of using `external` as a separate-line key: ```yml networks: service: external: name: hpcservice_service ``` we should define network by its name and specify its externality by using `external: true`: ```yml networks: service: name: hpcservice_service external: true ``` Official docs: https://docs.docker.com/compose/networking/#use-a-pre-existing-network By correctly specifying `external` property, we get rid of warning "network service: network.external.name is deprecated in favor of network.name". Useful link: docker-archive/compose-cli#1856 (comment)
…o uom * 'uom' of https://github.com/52North/data-transloader: Markdown lint Fix for docker-archive/compose-cli#1856 Minor changes
docker doc is incorrect. see docker-archive/compose-cli#1856 (comment)
Description
In compose v2 I always see
For every docker-compose command.
Here's the networks stanza:
This appears to be the exact same as is suggested in the official docs at https://docs.docker.com/compose/networking/#use-a-pre-existing-network - nothing about deprecation there.
And I also don't see
network.external.name
being used here. It's network.external as a bool, right?Steps to reproduce the issue:
Use the network stanza above.
Describe the results you received:
Describe the results you expected:
No deprecation complaint. Or at least one that I can understand.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker context show
:Output of
docker info
:Additional environment details (AWS ECS, Azure ACI, local, etc.):
This is Docker Desktop 3.5.1 on either macOS or Windows.
The text was updated successfully, but these errors were encountered: