Now that we have a network, we can start connecting containers to that network. And then we'll explore the containers to see how private they are.
Create a script, startdb.sh, containing:
docker run --name db-userauth --env MYSQL_RANDOM_ROOT_PASSWORD=true \ --env MYSQL_USER=userauth --env MYSQL_PASSWORD=userauth \ --env MYSQL_DATABASE=userauth \ --volume `pwd`/my.cnf:/etc/my.cnf \ --volume `pwd`/../userauth-data:/var/lib/mysql \ --network authnet mysql/mysql-server:5.7
On Windows, you will need to name the script startdb.ps1 instead, and put the text all on one line rather than extend the lines with backslashes. And, the volume mounted on /var/lib/mysql must be created separately. Use these commands instead: ...