Skip to content
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

Cannot link to /mysql, as it does not belong to the default network. #13

Closed
makorne opened this issue Mar 20, 2018 · 6 comments
Closed

Comments

@makorne
Copy link

makorne commented Mar 20, 2018

docker network create my-net
docker run --network my-net --name mysql -d mysql

docker run --name backup --link mysql -v /backup:/backup confirm/mysql-backup

Status: Downloaded newer image for confirm/mysql-backup:latest
docker: Error response from daemon: Cannot link to /mysql, as it does not belong to the default network.
ERRO[0016] error waiting for container: context canceled 

docker run --name backup --network my-net --link mysql -v /backup:/backup confirm/mysql-backup

ERROR: Couldn't find linked MySQL container.
Please link a MySQL or MariaDB container to the backup container and try again
@crizbe
Copy link

crizbe commented Oct 17, 2018

Hi makorne,
I run into the same error as you do.
Did you find a solution?

Regards cbxxn

@silviotroia
Copy link

+1

1 similar comment
@STX2k
Copy link

STX2k commented Apr 22, 2019

+1

@domibarton
Copy link
Member

Sorry I no longer use the container/image myself, thus supporting it is challening ;) I've to setup everything again to see how newer Docker versions work, especially with sharing the env vars.

In the meantime, did anyone try to fix or find the problem or was +1 the only effort in "supporting" open source? 😬

@domibarton
Copy link
Member

Closing this issue in favor #2, which is the root cause for the ERROR: Couldn't find linked MySQL container. error.

Regarding the network error: This is a "Docker" thing and everyone using Docker should be aware of it. IMHO it doesn't make any sense to repeatedly document this in every docker image / container using links. However, a note could be helpful in the docs :)

@limbuu
Copy link

limbuu commented Jun 17, 2019

you just need to add --network my-net in second line as well i.e
docker network create my-net
docker run --network my-net --name mysql -d mysql
docker run --network my-net --name backup --link mysql -v /backup:/backup confirm/mysql-backup

It is necessary to run all containers you want to link within same network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants