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

GitHub Action

Docker Setup Docker

v2.2.0

Docker Setup Docker

anchor

Docker Setup Docker

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

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Docker Setup Docker

uses: crazy-max/ghaction-setup-docker@v2.2.0

Learn more about this action in crazy-max/ghaction-setup-docker

Choose a version

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.

Screenshot


Usage

Quick start

name: ci

on:
  push:

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      -
        name: Set up Docker
        uses: crazy-max/ghaction-setup-docker@v2

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: crazy-max/ghaction-setup-docker@v2
        with:
          daemon-config: |
            {
              "debug": true,
              "features": {
                "containerd-snapshotter": true
              }
            }

Define custom colima start arguments (macOS)

You can define custom colima start arguments using the COLIMA_START_ARGS environment variable to customize the VM:

name: ci

on:
  push:

jobs:
  docker:
    runs-on: macos-latest
    steps:
      -
        name: Set up Docker
        uses: crazy-max/ghaction-setup-docker@v2
        env:
          COLIMA_START_ARGS: --cpu 4 --memory 8 --disk 32

Customizing

inputs

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.

Contributing

Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. You can also support this project by becoming a sponsor on GitHub or by making a PayPal donation to ensure this journey continues indefinitely!

Thanks again for your support, it is much appreciated! 🙏

License

Apache-2.0. See LICENSE for more details.