You are working on a project and need to deploy a MySQL container to the development environment. Because you will be working with mock customer data that needs to be persistent, the container will need a volume. Create a volume called mysql_data. Then deploy a MySQL container that will use this volume to store database files.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Create a Volume Called `mysql_data`
Use the docker
volume
command to create a volume calledmysql_data
.[cloud_user@host]$ docker volume create mysql_data
- Create a MySQL Container
Use the docker
container
command to create a MySQL container:[cloud_user@host]$ docker container run -d --name app-database --mount type=volume,source=mysql_data,target=/var/lib/mysql -e MYSQL_ROOT_PASSWORD=P4ssW0rd0! mysql:latest