Skip to content

Warning

You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?

Docker Setup Docker

Actions
Set up Docker for use in GitHub Actions by downloading and installing a version of Docker CE
v4.0.0
Verified creator
Star (40)

Verified

GitHub has manually verified the creator of the action as an official partner organization. For more info see About badges in GitHub Marketplace.

GitHub release GitHub marketplace CI workflow Test workflow Codecov

About

GitHub Action to set up (download and install) Docker CE. Works on Linux, macOS and Windows.

Note

This action is useful if you want to pin against a specific Docker version or set up a custom daemon configuration or if Docker is not available on your runner. If you're using GitHub-hosted runners on Linux or Windows, Docker is already up and running, so it might not be necessary to use this action.

Warning

Does not work on macOS runners with ARM architecture (no nested virtualization):

Screenshot


Usage

Quick start

name: ci

on:
  push:

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      -
        name: Set up Docker
        uses: docker/setup-docker-action@v3

Daemon configuration

You can configure the Docker daemon using the daemon-config input. In the following example, we configure the Docker daemon to enable debug and the containerd image store feature:

name: ci

on:
  push:

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      -
        name: Set up Docker
        uses: docker/setup-docker-action@v3
        with:
          daemon-config: |
            {
              "debug": true,
              "features": {
                "containerd-snapshotter": true
              }
            }

Define custom limactl start arguments (macOS)

You can define custom limactl start arguments using the LIMA_START_ARGS environment variable to customize the VM:

name: ci

on:
  push:

jobs:
  docker:
    runs-on: macos-latest
    steps:
      -
        name: Set up Docker
        uses: docker/setup-docker-action@v3
        env:
          LIMA_START_ARGS: --cpus 4 --memory 8

Customizing

inputs

The following inputs can be used as step.with keys

Name Type Default Description
version String latest Docker CE version (e.g., v24.0.6).
channel String stable Docker CE channel (e.g, stable, edge or test).
daemon-config String Docker daemon JSON configuration
context String setup-docker-action Docker context name.
set-host Bool false Set DOCKER_HOST environment variable to docker socket path.
rootless Bool false Start daemon in rootless mode

outputs

The following outputs are available

Name Type Description
sock String Docker socket path

Contributing

Want to contribute? Awesome! You can find information about contributing to this project in the CONTRIBUTING.md

License

Apache-2.0. See LICENSE for more details.

Docker Setup Docker is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Set up Docker for use in GitHub Actions by downloading and installing a version of Docker CE
v4.0.0

Verified

GitHub has manually verified the creator of the action as an official partner organization. For more info see About badges in GitHub Marketplace.

Docker Setup Docker is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.