5. Docker Basics - jcmwright80/work-experience GitHub Wiki

In this tutorial we introduce the concept of Docker and containers which are used to deploy tools or applications in isolated virtualised environments which are lightweight and defined programatically.

This allows us to locally stand up tools such as a MySQL database in a linux container without having to install it natively in windows which has several benefits:

  • Quick setup as most off the self docker containers come pre-configured with sensible defaults
  • Easy to switch between different versions of the same product without having conflicts or the need to uninstall / reinstall constantly
  • Consistency across developer machines and environments as the docker file ensures a consistent configuration and behaviour for all.

Step 1. Install Docker Desktop

Step 2. Start Docker Desktop

Step 3. Run MySQL container using the command below but ensuring you understand first how docker works and what the different parts of the command mean:

docker run --name mysql-todo -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=todo -p 3306:3306 -d mysql:8

Step 4. Install MySQL Workbench natively in windows and ensure you can connect it to your local database running in docker.