How to Set Up Docker for Your Projects

Article originally published on the Platzi blog and my former WordPress blog.
Today, a short tutorial on one of the most useful tools to test packages without messing with your OS: Docker.
In this example we’ll run a MySQL server container.
Docker
Two installation options (Windows examples):
- Docker Desktop (Win 10 Pro/Enterprise)
- Docker Toolbox (older setups/WSL)
MySQL
Commands I used:
- Pull image:
docker pull mysql
- Run container:
docker run --name mysql-library -e MYSQL_ROOT_PASSWORD=password -p 3306:3306 -d mysql:latest
- Exec into container:
docker exec -it mysql-library bash
- Connect to MySQL:
mysql -u root -ppassword
That’s it—you now have a MySQL instance to play with.