Files
setup-docker-action/README.md

131 lines
4.8 KiB
Markdown
Raw Normal View History

2023-03-02 14:17:20 +01:00
[![GitHub release](https://img.shields.io/github/release/crazy-max/ghaction-setup-docker.svg?style=flat-square)](https://github.com/crazy-max/ghaction-setup-docker/releases/latest)
[![GitHub marketplace](https://img.shields.io/badge/marketplace-docker--setup--docker-blue?logo=github&style=flat-square)](https://github.com/marketplace/actions/docker-setup-docker)
[![CI workflow](https://img.shields.io/github/actions/workflow/status/crazy-max/ghaction-setup-docker/ci.yml?branch=master&label=ci&logo=github&style=flat-square)](https://github.com/crazy-max/ghaction-setup-docker/actions?workflow=ci)
[![Test workflow](https://img.shields.io/github/actions/workflow/status/crazy-max/ghaction-setup-docker/test.yml?branch=master&label=test&logo=github&style=flat-square)](https://github.com/crazy-max/ghaction-setup-docker/actions?workflow=test)
[![Codecov](https://img.shields.io/codecov/c/github/crazy-max/ghaction-setup-docker?logo=codecov&style=flat-square)](https://codecov.io/gh/crazy-max/ghaction-setup-docker)
## About
2023-03-10 01:58:55 +01:00
GitHub Action to set up (download and install) [Docker CE](https://docs.docker.com/engine/).
Works on Linux, macOS and Windows.
2023-03-02 14:17:20 +01:00
![Screenshot](.github/setup-docker-action.png)
___
* [Usage](#usage)
2023-08-27 14:43:03 +02:00
* [Quick start](#quick-start)
* [Daemon configuration](#daemon-configuration)
2023-12-18 10:41:32 +01:00
* [Define custom `limactl start` arguments (macOS)](#define-custom-limactl-start-arguments-macos)
2023-03-02 14:17:20 +01:00
* [Customizing](#customizing)
* [inputs](#inputs)
2024-02-29 16:20:43 +01:00
* [outputs](#outputs)
2023-03-02 14:17:20 +01:00
* [Contributing](#contributing)
2023-03-10 11:17:01 +01:00
* [License](#license)
2023-03-02 14:17:20 +01:00
## Usage
2023-08-27 14:43:03 +02:00
### Quick start
```yaml
name: ci
on:
push:
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up Docker
2023-12-18 11:10:28 +01:00
uses: crazy-max/ghaction-setup-docker@v3
2023-08-27 14:43:03 +02:00
```
### Daemon configuration
You can [configure the Docker daemon](https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file)
using the `daemon-config` input. In the following example, we configure the
Docker daemon to enable debug and the [containerd image store](https://docs.docker.com/storage/containerd/)
feature:
2023-03-02 14:17:20 +01:00
```yaml
name: ci
on:
push:
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up Docker
2023-12-18 11:10:28 +01:00
uses: crazy-max/ghaction-setup-docker@v3
2023-08-27 14:43:03 +02:00
with:
daemon-config: |
{
"debug": true,
"features": {
"containerd-snapshotter": true
}
}
2023-03-02 14:17:20 +01:00
```
2023-12-18 10:41:32 +01:00
### Define custom `limactl start` arguments (macOS)
2023-12-18 10:41:32 +01:00
You can define custom [`limactl start` arguments](https://lima-vm.io/docs/reference/limactl_start/)
using the `LIMA_START_ARGS` environment variable to customize the VM:
```yaml
name: ci
on:
push:
jobs:
docker:
runs-on: macos-latest
steps:
-
name: Set up Docker
2023-12-18 11:10:28 +01:00
uses: crazy-max/ghaction-setup-docker@v3
env:
2023-12-18 10:41:32 +01:00
LIMA_START_ARGS: --cpus 4 --memory 8
```
2023-03-02 14:17:20 +01:00
## Customizing
### inputs
2023-12-18 10:41:32 +01:00
The following inputs can be used as `step.with` keys
2023-03-02 14:17:20 +01:00
2023-08-27 14:43:03 +02:00
| Name | Type | Default | Description |
|-----------------|--------|-----------------------|-----------------------------------------------------------------------------------------------------------------------------|
2023-09-10 15:43:27 +02:00
| `version` | String | `latest` | Docker CE version (e.g., `v24.0.6`). |
2023-08-27 14:43:03 +02:00
| `channel` | String | `stable` | Docker CE [channel](https://download.docker.com/linux/static/) (e.g, `stable`, `edge` or `test`). |
| `daemon-config` | String | | [Docker daemon JSON configuration](https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file) |
| `context` | String | `setup-docker-action` | Docker context name. |
| `set-host` | Bool | `false` | Set `DOCKER_HOST` environment variable to docker socket path. |
2023-03-02 14:17:20 +01:00
2024-02-29 16:20:43 +01:00
### outputs
The following outputs are available
| Name | Type | Description |
|--------|--------|--------------------|
| `sock` | String | Docker socket path |
2023-03-02 14:17:20 +01:00
## Contributing
2023-03-10 11:17:01 +01:00
Want to contribute? Awesome! The most basic way to show your support is to star
2023-09-10 15:43:27 +02:00
the project, or to raise issues. You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max)
2023-03-10 11:17:01 +01:00
or by making a [PayPal donation](https://www.paypal.me/crazyws) to ensure this
journey continues indefinitely!
Thanks again for your support, it is much appreciated! :pray:
## License
Apache-2.0. See `LICENSE` for more details.