Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Everything Docker

asmural edited this page Mar 18, 2021 · 2 revisions

What is Docker?

From the Docker documentation page, "Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. By taking advantage of Docker’s methodologies for shipping, testing, and deploying code quickly, you can significantly reduce the delay between writing code and running it in production."


Installing Docker

What's Included in Docker Desktop?

Docker Desktop includes Docker Engine, Docker CLI client, Docker Compose, Notary, Kubernetes, and Credential Helper!

Installing on macOS

  1. Download Docker for MacOS from Docker Hub.
  2. Double-click the disk image (dmg) to begin the installation.
  3. Once finished, drag and drop the Docker app into your /Applications folder.
  4. Navigate to your /Applications folder (Finder > Go > Applications).
  5. Locate Docker and double-click to launch.
    • If prompted with, “Docker” is an app downloaded from the Internet. Are you sure you want to open it?" simply click, open.
    • You may be asked to provide administrator privileges to Docker. It is in your best interest to do so.
  6. Done!

You can check the status of Docker Desktop by looking at your menu bar and locating the 🐳 icon. If 🐳 is not present, Docker Desktop is not running.

Installing on Windows

  1. Download Docker for Windows from Docker Hub.
  2. Once the executable has been downloaded, double-click to launch the installation wizard.
  3. When prompted, check the Enable WSL 2 Windows Features and, optionally Add shortcut to desktop boxes, and hit, ok.
  4. The installation wizard will now begin to unpack some files; once this is finished, you must restart Windows.
  5. After restarting Windows, open up the command prompt and run the command docker version.
    • If Windows is unable to recognize the command, Docker has not been installed correctly. Please carefully review the steps above.
    • If after running docker version, you notice the error message error during connect: ... This error may indicate that the docker daemon is not running, you need to restart Windows.
  6. Done!

Installing on Linux

Due to the variations in package managers/commands for the different Linux distributions, it is best to follow the official installation guide for installing Docker Engine on your Linux machine.


Running/Stopping the Containers

Running the Container

  1. Locate and navigate to your local copy of the repository. Eg. cd <folder>/ ... cd 320-S21-Track2/.
  2. Run the command docker-compose up.
    • Note that this may take a while to complete. If successful, you should see the message "You can now view ethisim in the browser" at the bottom of your terminal.
    • Alternatively/Optionally you may want to run docker-compose up -d where -d stands for "detached mode." Detached mode starts the containers in the background and leaves them running.

Hot Reloading

If you'd like to run the docker containers with hot reloading, run the following command:

  1. docker-compose -f docker-compose-hot-reload.yaml -f docker-compose.yaml up

This is an alternative to running the containers in production mode (ie. running docker-compose up)

Stopping the Container

  1. Hit Ctrl-C to gracefully stop the containers.
    • If running in detached mode, execute the command docker-compose stop instead.
  2. (Optional Step) If you only need to stop the Docker services (containers), no further action is required. If you want to rebuild the images or use different images in future builds, you may consider running docker-compose down. Consult the documentation for more information on docker-compose down.