Skip to content

separate container create request from inspect#51204

Draft
thaJeztah wants to merge 1 commit intomoby:masterfrom
thaJeztah:create_separate
Draft

separate container create request from inspect#51204
thaJeztah wants to merge 1 commit intomoby:masterfrom
thaJeztah:create_separate

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah
Copy link
Copy Markdown
Member Author

This will explode currently; but for discussion

@thaJeztah
Copy link
Copy Markdown
Member Author

thaJeztah commented Oct 17, 2025

Right, so I realised we also use the same things directly or indirectly for network attach, so methods using those would / should also be updated accordingly if we want to do this.

And ... probably it makes sense to have them the same, because effectively the container create is a "create a container AND attach to <list of networks>" on the daemon side

35.61 # github.com/moby/moby/v2/daemon
35.61 daemon/create.go:390:45: cannot use v (variable of type *"github.com/moby/moby/api/types/container".EndpointSettings) as *"github.com/moby/moby/api/types/network".EndpointSettings value in argument to validateEndpointSettings
44.94 # github.com/moby/moby/v2/daemon/server/router/container
44.94 daemon/server/router/container/container_routes.go:693:32: cannot use networkingConfig (variable of struct type "github.com/moby/moby/api/types/container".NetworkingAttachOptions) as *"github.com/moby/moby/api/types/container".NetworkingAttachOptions value in struct literal

To some extent even considering if NetworkConnect should actually be considered part of the Container API; it's currently reversed (take a network and attach a container);

// NetworkConnect connects a container to an existent network in the docker host.
func (cli *Client) NetworkConnect(ctx context.Context, networkID, containerID string, config *network.EndpointSettings) error {
networkID, err := trimID("network", networkID)
if err != nil {

But perhaps the reverse would be to enhance docker container update, to add options for adding / removing networks, similar to docker service update;

docker service update --help | grep network
      --network-add network                Add a network
      --network-rm list                    Remove a network

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

2 participants