How to Set Up Docker for Your Projects

Info

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

  1. Docker Desktop (Win 10 Pro/Enterprise)
  2. Docker Toolbox (older setups/WSL)

MySQL

Commands I used:

  1. Pull image: docker pull mysql
  2. Run container: docker run --name mysql-library -e MYSQL_ROOT_PASSWORD=password -p 3306:3306 -d mysql:latest
  3. Exec into container: docker exec -it mysql-library bash
  4. Connect to MySQL: mysql -u root -ppassword

That’s it—you now have a MySQL instance to play with.


programming software

117 Words

2020-06-18