-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add docker network command #34
Comments
Nice! In each section/example above, can we add the corresponding The Would we want to support the full suite of If so, thoughts on how to represent in syntax? Should we have a dedicated section for
(Similar thoughts apply to #35) |
I added the commands.
If we want to support all the possible commands, well, I guess, we should have another approach to handle them without too much complexity for the end-user. I created those issues to talk about the correct design. And what you suggested could go in this direction, let me try to adapt the above examples with your approach. Like that, we'll have examples for both designs:
docker:
description: "Create a network"
network:
command: create
name: networkName
docker:
description: "Delete a network"
network:
command: rm
name: networkName
docker:
description: "Add container to a network"
network:
command: connect
name: networkName
containers:
- containerA
- containerB
docker:
description: "Disconnect container from a network"
network:
command: disconnect
name: networkName
containers:
- containerA
- containerB
docker:
description: "Force container disconnect on a network"
network:
command: disconnect
name: networkName
containers:
- containerA
- containerB
force: true |
@jaudiger thanks for adding the commands in-line -- super helpful. I do think, even if we don't implement all of the network sub-commands in a first PR, we design things such that more could be added. Somehow my initial suggestion of
I have a feeling that doing so might help keep each (sub-)command's schema distinct from others... though that's just a hunch as I haven't looked at what the updated schema is like. These are just thoughts/suggestions, though. Happy to learn about what you're leaning towards as well. |
My feedbacks about the three approaches (list in the same order as inside this issue):
Example: docker:
description: "Force container disconnect on a network"
network:
connect:
name: networkName
containers:
- containerA
- containerB
disconnect:
name: networkName
containers:
- containerA
- containerB
force: true |
I agree, I don't think we should allow multiple subcommands under one I'm still leaning towards 3, with direct mapping of yaml fields to |
I tend to the same conclusion. My favorite approach is the last one. Since it's easier to understand and to expand for future commands. |
Reference: https://docs.docker.com/engine/reference/commandline/network/
Proposed initial syntax (more can be added in future):
docker network create networkName
docker network rm networkName
docker network connect networkName containerA containerB
docker network disconnect networkName containerA containerB
docker network disconnect -f networkName containerA containerB
The
network
command can be useful to create/delete a network and associated them with containers.The text was updated successfully, but these errors were encountered: