How to Install Docker

Docker is a powerful containerization platform that allows you to run applications in isolated containers. It is the simplest yet default way to run Gluesync. This guide provides installation instructions for Linux, Windows, and Mac operating systems.

Linux

Rootless Docker

Docker can be configured to run without root privileges using rootless mode. This enhances security by allowing Docker to run as a regular user. For detailed instructions, see: https://docs.docker.com/engine/security/rootless/

Distribution-Specific Installation

Fedora

Enable the Docker repository:

sudo dnf -y install dnf-plugins-core
echo "[docker-stable]" | sudo tee /etc/yum.repos.d/docker-ce.repo

Install Docker:

sudo dnf -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Start and enable Docker:

sudo systemctl start docker
sudo systemctl enable docker

Ubuntu

Update package index and install required packages:

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

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

Set up the repository:

echo "deb [arch=$(dpkg --print-architecture) 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

Install Docker:

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

RedHat

Install required packages:

sudo yum install -y yum-utils

Add Docker repository:

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Install Docker:

sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Start Docker:

sudo systemctl start docker
sudo systemctl enable docker

Debian

Update package index:

sudo apt-get update

Install required packages:

sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release

Add Docker’s official GPG key:

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Set up the repository:

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install Docker:

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

CentOS

Install required packages:

sudo yum install -y yum-utils

Add Docker repository:

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Install Docker:

sudo yum install docker-ce docker-ce-cli containerd.io

Start Docker:

sudo systemctl start docker
sudo systemctl enable docker

Post-Installation Configuration

Docker Registry Access Requirements

In order to have Gluesync working with Docker and allow pulling Gluesync’s Docker images, the following requirements must be met:

There are two ways to work around Docker Hub access restrictions:

  1. Allow (whitelist) Docker registry at your proxy/firewall level, specifically allowing the following trusted domains:

    • *.docker.io

    • *.docker.com

    • *.dckr.io

  2. Save and load images manually if you cannot access Docker Hub:

    # Save the image to a tar file
    docker image XYZ save > image.tar
    
    # Load the image on your private registry or local machine
    docker image load < image.tar
Manually loading images from a tar file is a labor intensive process and is not recommended, as it requires downloading the images from Docker Hub and loading them manually.

Configure Docker to Start on Boot with systemd

Most modern Linux distributions use systemd to manage system services. Docker is configured to start automatically on boot by default on most distributions. However, you can verify and manage this behavior using the following systemd commands:

Enable Docker to Start on Boot

To ensure Docker and containerd start automatically at system boot, run:

sudo systemctl enable --now docker.service
sudo systemctl enable --now containerd.service

The --now flag will also start the services immediately in addition to enabling them.

Disable Automatic Startup

If you need to prevent Docker from starting at boot, use:

sudo systemctl disable --now docker.service
sudo systemctl disable --now containerd.service

Customize Docker Service Configuration

You can customize Docker’s behavior by creating or modifying systemd drop-in files. For example, to configure an HTTP proxy or set a custom directory for Docker runtime files:

  1. Create a systemd drop-in directory:

sudo mkdir -p /etc/systemd/system/docker.service.d/
  1. Create a custom configuration file (e.g., http-proxy.conf):

[Service]
Environment="HTTP_PROXY=http://proxy.example.com:8080/"
Environment="HTTPS_PROXY=http://proxy.example.com:8080/"
Environment="NO_PROXY=localhost,127.0.0.1,.example.com"
  1. Reload systemd and restart Docker:

sudo systemctl daemon-reload
sudo systemctl restart docker

For more configuration options, refer to the official Docker documentation on systemd configuration.

Configure Log Driver and Retention

You can customize Docker’s logging configuration by creating or modifying /etc/docker/daemon.json:

{
    "log-driver": "json-file",
    "log-opts": {
        "max-size": "100m",
        "max-file": "5"
    }
}

Restart Docker after making changes:

systemctl restart docker

Windows

Windows Desktop

  1. Download Docker Desktop from: https://www.docker.com/products/docker-desktop/

  2. Run the installer and follow the on-screen instructions

  3. After installation, Docker Desktop will start automatically

Windows Server

Install WSL 2:

wsl --install

Open PowerShell as administrator and run the following commands:

  • Click the Start button and search for "PowerShell"

  • Right-click on Windows PowerShell and select "Run as administrator"

  • Check winget availability by running:

winget --version
  • If winget is not available, install it first:

Install-Script winget-install -Force

When prompted to confirm installation from an untrusted repository, type 'Y' and press Enter.

Then run the installation script:

winget-install

Follow the on-screen prompts to complete the winget installation.

  • Install Docker Desktop for Windows Server:

winget install --id Docker.DockerDesktop -e --accept-source-agreements --accept-package-agreements

After installation completes, verify Docker is running by opening a new Command Prompt and running:

docker --version

Mac

  • Download Docker Desktop for Mac from: https://www.docker.com/products/docker-desktop/

  • Open the downloaded .dmg file

  • Drag Docker to your Applications folder

  • Launch Docker from your Applications folder

  • Follow the on-screen setup instructions

Post-Installation

After installation, Docker will start automatically and add itself to your system preferences. You can configure Docker settings through the Docker Desktop application.

Verify Docker Installation

Before attempting to run Gluesync, verify that Docker is working correctly by running the hello-world container:

docker run hello-world

You should see a message indicating that your installation is working correctly. If you encounter any errors, resolve them before proceeding with Gluesync.