Internet Explorer is no longer supported. Many things will still work, but your experience will be degraded and some things won't function. Please use a modern browser such as Edge, Chrome, or Firefox.

Installing & Integrating with Docker Engine

view on GitHub

BuildMaster's Docker/Containers features rely on a Docker Engine that's installed on a Linux or Windows server.

This article provides guidance on how to install Docker Engine on a server, as well as how BuildMaster detects and integrates with Docker.

How to Install Docker Engine

Although Linux is the most popular operating system for Docker Engine, you can also install it on Windows. In either case, it's really easy: just run one of the official installation scripts that we've linked below.

Aside from resource limitations, there's no problem installing or using a Docker Engine on the same server as BuildMaster. If you're running BuildMaster on Linux, then can simply connect to the host's server using an SSH-based agent.

Installing Docker Engine on Linux

Installing Docker on Linux is relatively easy, especially if you use Docker's convenience script. You simply run this command to automatically install Docker:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

Otherwise, just follow Docker's official installation documentation for the commands you'll need to run.

Installing Docker Engine on Windows

Docker on Windows comes in two flavors, depending on the types of containers you want to work with:

  • Docker for Windows allows you build and run Windows-based containers on a server, but you won't be able to build or run Linux-based containers.
  • Docker on WSL allows you to build and run Linux-based containers on a server, but it's more complex and Microsoft does not support it in production environments.

If you plan to work with Linux-based containers, we recommend using a Linux-based server instead.

How to install Docker for Windows

To build or run Windows containers on a Windows server, you'll need to enable certain Windows features and install a supported container runtime.

The easiest way to install Docker for Windows is by running Microsoft's quick installation script to install Moby, which is Microsoft's recommended runtime.

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

However, there are other supported runtimes such as Mirantis and Containerd. See Microsoft’s documentation to learn more.

How to install Docker using WSL

To build or run Linux containers on a Windows server, you'll need to enable certain Windows features, install WSL2, install Ubuntu, and then finally install Docker.

Installing Docker on WSL is bit complex and it may not work on your hardware.

We plan to write our own tutorial for Installing Docker on WSL, but in the meantime we recommend following the steps in this blog: How To Install Docker Without Docker Desktop On Windows

How BuildMaster Detects Docker Engine

BuildMaster will automatically detect when Docker Engine is installed on the BuildMaster server or on any connected server. This detection occurs during routine server scanning, and can be manually triggered on the Servers page with the Refresh Status button.

To determine which Docker Engine is installed on a Linux-based server, BuildMaster will attempt to execute docker version. On a Windows-based server, BuildMaster will run docker.exe version (to check for Docker for Windows) and wsl.exe docker version (to check for Docker on WSL). If these result in an error (such as file not found), then Docker Engine is assumed to not be present.

When Docker is detected on a server, BuildMaster will routinely check for containers using docker ps. You can view these containers by clicking the "view containers" link on the server's details page.