Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

359
Views
Why can't i attach a container to a docker network?

I've created a user defined attachable overlay swarm network. I can inspect it, but when i attempt to attach a container to it, i get the following error when running on the manager node:

$ docker network connect mrunner baz 
Error response from daemon: network mrunner not found

The network is defined and is attachable

$ docker network inspect mrunner
[
    {
        "Name": "mrunner",
        "Id": "kviwxfejsuyc9476eznb7a8yw",
        "Created": "2019-06-20T21:25:45.271304082Z",
        "Scope": "swarm",
        "Driver": "overlay",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "10.0.1.0/24",
                    "Gateway": "10.0.1.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": true,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": null,
        "Options": {
            "com.docker.network.driver.overlay.vxlanid_list": "4098"
        },
        "Labels": null
    }
]


$ docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
4a454d677dea        bridge              bridge              local
95383b47ee94        docker_gwbridge     bridge              local
249684755b51        host                host                local
zgx0nppx33vj        ingress             overlay             swarm
kviwxfejsuyc        mrunner             overlay             swarm
a30a12f8d7cc        none                null                local
uftxcaoz9rzg        taskman_default     overlay             swarm

Why is this network connection failing?

** This was answered here: https://github.com/moby/moby/issues/39391

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

See this:

To create an overlay network for use with swarm services, use a command like the following:

$ docker network create -d overlay my-overlay

To create an overlay network which can be used by swarm services or standalone containers to communicate with other standalone containers running on other Docker daemons, add the --attachable flag:

$ docker network create -d overlay --attachable my-attachable-overlay

So, by default overlay network cannot be used by standalone containers, if insist on, you need to add --attachable to allow this network be used by standalone containers.

over 4 years ago · Santiago Trujillo Report

0

Thanks to thaJeztah on docker git repo:

The solution is as follows, but essentially make the flow service centric:

docker network create -d overlay --attachable --scope=swarm somenetwork

docker service create --name someservice nginx:alpine

If you want to connect the service to the somenetwork after it was created, update the service;

docker service update --network-add somenetwork someservice

After this; all tasks of the someservice service will be connected to somenetwork (in addition to other overlay networks they were connected to).

https://github.com/moby/moby/issues/39391#issuecomment-505050610

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!