Skip to content

Commit 7cd9694

Browse files
committed
Improve documentation example
- Documentation said that mysql client used in second container could use `some-network`. Problema with this (for the new users at least) is how to create the new network and that `some-network` excludes `bridge` network. Here is an example: ``` $ docker network create mariadb-net $ docker network ls NETWORK ID NAME DRIVER SCOPE 6619c329efd7 bridge bridge local c40fe8f5347a host host local ddff491eb0b3 mariadb-net bridge local 03bba7bb6438 none null local $ docker run --network bridge --name mariadb-c1 -e MYSQL_ROOT_PASSWORD=root -d mariadb:10.5 9c64c725816e9950e92dfd2a0a65eb37e8c801e452ae2e5c3eb78c6907ef4d9d $ docker run -it --network bridge --rm mariadb:10.5 mysql -hmariadb-c1 -uroot -proot ERROR 2005 (HY000): Unknown MySQL server host 'mariadb-c1' (-2) $ docker stop mariadb-c1 && docker rm mariadb-c1 $ docker run --network mariadb-net --name mariadb-c1 -e MYSQL_ROOT_PASSWORD=root -d mariadb:10.5 $ docker run -it --net mariadb-net --rm mariadb:10.5 mysql -hmariadb-c1 -uroot -proot Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 3 Server version: 10.5.8-MariaDB-1:10.5.8+maria~focal mariadb.org binary distribution Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> ``` - Also in documentation when second/client container is created reference to `some-network` is not explained and this patch solves that.
1 parent 60b26a6 commit 7cd9694

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mariadb/README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,12 @@ The intent is also to maintain high compatibility with MySQL, ensuring a "drop-i
6666
Starting a MariaDB instance is simple:
6767

6868
```console
69-
$ docker run --name some-mariadb -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mariadb:tag
69+
# Create the network
70+
$ docker network create some-network
71+
$ docker run --net some-network --name some-mariadb -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mariadb:tag
7072
```
7173

72-
... where `some-mariadb` is the name you want to assign to your container, `my-secret-pw` is the password to be set for the MySQL root user and `tag` is the tag specifying the MySQL version you want. See the list above for relevant tags.
74+
... where `some-network` is newly created network (other than `bridge` as the default network), `some-mariadb` is the name you want to assign to your container, `my-secret-pw` is the password to be set for the MySQL root user and `tag` is the tag specifying the MySQL version you want. See the list above for relevant tags.
7375

7476
## Connect to MariaDB from the MySQL command line client
7577

0 commit comments

Comments
 (0)