manage_multiple_containers.md (562B)
1 # manage multiple containers 2 3 https://docs.docker.com and `--help` are your friend 4 5 * 3 container app 6 * nginx, mysql, httpd 7 * run all with `--detach` and `--name` 8 * nginx on `80:80` 9 * httpd on `8080:80` 10 * mysql on `3306:3306` 11 * when running mysql use `--env` to pass var 12 * `MYSQL_RANDOM_ROOT_PASSWORD=yes` 13 14 ``` 15 docker container run -d -p 80:80 --name nginx <nginx_image>:latest 16 docker container run -d -p 8080:80 --name httpd <httpd_image>:latest 17 docker container run -d -p 3306:3306 --name mysql --env MYSQL_RANDOM_ROOT_PASSWORD=yes <mysql_image>:latest 18 ```