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

Configure Log Driver and Retention

Follow this steps to configure Docker’s logging driver and retention policy to avoid running out of disk space. As it is not being automatically configured by Docker at install time.

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

Post-Installation Configuration

Docker Registry Access Requirements

In order to have Gluesync working with Docker and allow pulling Gluesync’s Docker images, the host machine must be able to access Docker Hub Registry.

In case you cannot access Docker Hub Registry, 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.

macOS

Installation

  1. Download Docker Desktop for Mac from the official Docker website: https://www.docker.com/products/docker-desktop/

  2. Open the downloaded .dmg file and drag Docker.app to the Applications folder

  3. Launch Docker from your Applications folder

  4. Follow the on-screen instructions to complete the setup

Auto-start Configuration

Docker Desktop for Mac can be configured to start automatically when you log in to your Mac. There are two ways to enable this:

  1. Open "System Settings" (or "System Preferences" in older macOS versions)

  2. Go to "General" and then "Login Items"

  3. Click the "+" button to add Docker to the list of applications that start automatically

  4. Select Docker.app from your Applications folder

  5. Make sure the "Hide" option is unchecked to see the Docker icon in the menu bar

Using Command Line (Advanced)

For advanced users who prefer command-line configuration:

  1. Create a LaunchAgent configuration file:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
      <key>Label</key>
      <string>com.docker.docker</string>
      <key>ProgramArguments</key>
      <array>
        <string>/Applications/Docker.app/Contents/MacOS/Docker</string>
      </array>
      <key>RunAtLoad</key>
      <true/>
      <key>KeepAlive</key>
      <true/>
      <key>StandardErrorPath</key>
      <string>/tmp/com.docker.docker.err</string>
      <key>StandardOutPath</key>
      <string>/tmp/com.docker.docker.out</string>
    </dict>
    </plist>
  2. Save this file as ~/Library/LaunchAgents/com.docker.docker.plist

  3. Load the launch agent:

    launchctl load ~/Library/LaunchAgents/com.docker.docker.plist
  4. Verify the agent is loaded:

launchctl list | grep com.docker.docker

Verifying Auto-start

After configuring auto-start, restart your Mac to verify that Docker starts automatically. The Docker icon should appear in your menu bar, and you can check its status by clicking on it.

To manually start Docker if needed:

open -a Docker

To stop Docker:

osascript -e 'quit app "Docker"'

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.

Windows

Windows Desktop

  1. Download and install Docker Desktop for Windows from the official site.

  2. Follow the on-screen instructions to complete the setup.

  3. After installation, Docker will start automatically.

Auto-start Configuration

Docker Desktop for Windows can be configured to start automatically when you log in to your Windows machine. Here are the recommended methods:

  1. Open Docker Desktop

  2. Click on the gear icon (⚙️) in the top-right corner to open Settings

  3. In the "General" section, enable "Start Docker Desktop when you log in"

  4. Click "Apply & Restart" to save changes

Using Windows Task Manager

  1. Press Ctrl + Shift + Esc to open Task Manager

  2. Go to the "Startup" tab

  3. Find "Docker Desktop" in the list

  4. Right-click and select "Enable"

  5. Restart your computer to apply changes

Using WSL (Windows Subsystem for Linux)

If you’re using WSL for Docker:

  1. Ensure WSL is enabled and you have a Linux distribution installed

  2. Install Docker in your WSL environment:

    # Update package lists
    sudo apt-get update
    
    # Install Docker
    sudo apt-get install docker.io
    
    # Enable and start Docker service
    sudo systemctl enable docker
    sudo systemctl start docker
  3. Add your user to the docker group to run Docker without sudo:

    sudo usermod -aG docker $USER
  4. Restart your WSL terminal for changes to take effect

Windows Server

This installation is only available for Windows Server with desktop environment.

Simplied installation for Windows Server:

Copy the following script to a file named install-docker-ce.ps1 and run it from an elevated PowerShell:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/Windows-Containers/Main/helpful_tools/Install-DockerCE/install-docker-ce.ps1" -o install-docker-ce.ps1
.\install-docker-ce.ps1

Other installation methods (manual):

  • Install WSL 2 by running the following command from your PowerShell:

wsl --install -d <distro> #you can select the distribution you want to install (e.g. Ubuntu)

Install Docker Desktop for Windows Server:

  • Install docker-desktop on the official site.

  • Then execute the installer and follow configuration step on-screen.

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

docker --version

Configuring Docker Service Auto-start

Using Windows Services Manager
  1. Open Windows Services Manager (search for "Services" in the Start menu)

  2. Locate the "Docker Desktop" or "Docker Engine" service

  3. Right-click the service and select "Properties"

  4. In the "General" tab, set "Startup type" to "Automatic"

  5. Click "Apply" and then "OK"

After configuring these settings, the Docker service will start automatically when Windows boots, and any containers with restart policies will be automatically restarted as configured.

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.