docker: Error response from daemon: network mysql_net not found

Viewed 18

I'm running this command in Docker docker run --restart always --network mysql_net --ip 192.169.0.2 --name mariadb -e MARIADB_ROOT_PASSWORD=example -v mariadb:/var/lib/mysql -d mariadb

But I'm getting this error : docker: Error response from daemon: network mysql_net not found.

I've been looking for info for a while now but due to I'm starting in Docker and i didn't find any info I can't find a solution.

1 Answers

It is because the network mysql_net does not exists yet. You can create e.g. bridge network as follows:

docker network create -d bridge mysql_net

But I recommend you starting it with docker-compose. See in official docker hub page of e.g. mariadb for docker-compose example.

Related