The db-userauth container

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: ...

Get Node.js Web Development - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.