An open API service indexing awesome lists of open source software.

https://github.com/boringcache/docker-action

Cache Docker BuildKit layers with BoringCache via OCI registry proxy.
https://github.com/boringcache/docker-action

caching ci cicd dependency-management github-actions utilities

Last synced: 3 months ago
JSON representation

Cache Docker BuildKit layers with BoringCache via OCI registry proxy.

Awesome Lists containing this project

README

          

# boringcache/docker-action

Build Docker images with BuildKit cache backed by BoringCache.

By default this action runs a local OCI registry proxy, so BuildKit restores layers lazily instead of downloading the whole cache upfront.

## Quick start

```yaml
- uses: boringcache/docker-action@v1
with:
workspace: my-org/my-project
image: ghcr.io/${{ github.repository }}
tags: latest,${{ github.sha }}
env:
BORINGCACHE_SAVE_TOKEN: ${{ secrets.BORINGCACHE_SAVE_TOKEN }}
```

## Restore-only pull requests

The default `cache-backend: registry` path still needs a save-capable token today. For restore-only PR jobs, switch to `cache-backend: local` and use split tokens:

```yaml
- uses: boringcache/docker-action@v1
with:
workspace: my-org/my-project
image: ghcr.io/${{ github.repository }}
cache-backend: local
env:
BORINGCACHE_RESTORE_TOKEN: ${{ secrets.BORINGCACHE_RESTORE_TOKEN }}
BORINGCACHE_SAVE_TOKEN: ${{ github.event_name == 'pull_request' && '' || secrets.BORINGCACHE_SAVE_TOKEN }}
```

## Key inputs

| Input | Description |
|-------|-------------|
| `image` | Image name to build. |
| `workspace` | Workspace in `org/repo` form. Defaults to the repo name. |
| `tags` | Image tags. |
| `push` / `load` | Push to a registry or load into the local daemon. |
| `cache-backend` | `registry` for lazy proxy mode or `local` for explicit restore/save mode. |
| `cache-tag` | Override the cache tag derived from the image name. |
| `platforms` | Multi-platform build targets. |
| `build-args`, `secrets`, `target` | Common BuildKit build inputs. |

## Outputs

| Output | Description |
|--------|-------------|
| `image-id` | Built image ID. |
| `digest` | Built image digest. |
| `buildx-name` | Builder name. |
| `buildx-platforms` | Platforms supported by the builder. |

## Docs

- [GitHub Actions docs](https://boringcache.com/docs#docker-action)
- [GitHub Actions auth and trust model](https://boringcache.com/docs#actions-auth)
- [Native proxy integrations](https://boringcache.com/docs#cli-cache-registry)