Skip to content

Latest commit

 

History

History
175 lines (136 loc) · 7.09 KB

Docker_guide.md

File metadata and controls

175 lines (136 loc) · 7.09 KB

Docker Installation Guide for MacOS, Windows, and Linux

Wellcome Connecting Science GitHub Home Page
Wellcome Connecting Science Website

Table of Contents

Introduction

Docker is a platform that allows you to develop, ship, and run applications inside containers. Containers are lightweight and executable packages of software that include everything needed to run an application: code, runtime, system tools, libraries, and settings. This guide will walk you through the installation process of Docker on macOS, Windows, and Linux.

Prerequisites

Before installing Docker, ensure your system meets the following requirements:

  • macOS: macOS 10.15 or newer.
  • Windows: Windows 10 64-bit: Pro, Enterprise, or Education (Build 19041 or higher).
  • Linux: A 64-bit distribution running kernel version 3.10 or higher.

Docker Installation on macOS

1. Download Docker Desktop

2. Install Docker Desktop

  • Once the .dmg file is downloaded, double-click it to open.
  • Drag the Docker icon to the Applications folder.

3. Start Docker

  • Open the Docker application from the Applications folder.
  • Docker will launch and ask for system permissions to install components.
  • Enter your system password when prompted.

4. Verify Installation

  • Open a terminal and run the command:
    docker --version

Docker Installation on Windows

1. Download Docker Desktop

2. Install Docker Desktop

  • Run the installer and follow the on-screen instructions.
  • Make sure to enable the option to use WSL 2 (Windows Subsystem for Linux) during the installation process.

3. Verify Installation

  • Open Command Prompt or PowerShell and run:
    docker --version
  • This should return the version of Docker installed.

4. Run a Test Container

  • To verify Docker is working correctly, run:
    docker run hello-world
  • This command downloads and runs a simple container that outputs a confirmation message.

Docker Installation on Linux

1. Update Your Package Database

  • Open a terminal and run:
    sudo apt-get update

2. Install Prerequisites

  • Install necessary packages to allow apt to use a repository over HTTPS:
    sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

3. Add Docker’s GPG Key

  • Add Docker’s official GPG key:
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

4. Set Up the Stable Repository

  • Use the following command to set up the stable repository:
    echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

5. Install Docker

  • Update the package database and install Docker:
    sudo apt-get update
    sudo apt-get install docker-ce docker-ce-cli containerd.io

6. Add Your User to the Docker Group (Optional but Recommended)

  • To avoid using sudo for Docker commands, add your user to the docker group:
    sudo usermod -aG docker $USER
  • After running this command, log out and back in, or restart your system to apply the group changes.

7. Verify Installation

  • Check if Docker is installed correctly:
    docker --version

8. Run a Test Container

  • Run the following command to ensure Docker is functioning:
    docker run hello-world

Additional Resources

  • Docker Documentation: Comprehensive guide and reference for Docker installation, configuration, and usage.

  • Docker Hub: A cloud-based registry service that allows you to link code repositories, build images, and test them.

  • Linux Post-Installation Steps: Instructions on how to manage Docker as a non-root user, including adding users to the Docker group.

  • Docker Compose: A tool for defining and running multi-container Docker applications. Great for orchestrating multiple containers for a course.

  • Globus File Transfer: Research-oriented file transfer service that can be used to share large datasets.

  • VirtualBox Documentation: Official documentation for using VirtualBox, useful for comparison or as an alternative.

  • Linux Commands Cheat Sheet: A handy reference for common Linux commands, useful for working within Docker containers.

  • GitHub: A platform for hosting and collaborating on code, ideal for sharing course materials and Dockerfiles.


Wellcome Connecting Science GitHub Home Page

For more information or queries, feel free to contact us via the Wellcome Connecting Science website.
Find us on socials Wellcome Connecting Science Linktr