1
This commit is contained in:
parent
f09b6486f9
commit
db4412c876
10 changed files with 89 additions and 85 deletions
63
README.md
63
README.md
|
@ -7,12 +7,12 @@
|
|||
[](https://git.kokuwa.io/woodpecker/buildctl/pulls)
|
||||
[](https://git.kokuwa.io/woodpecker/buildctl/issues)
|
||||
|
||||
A [Woodpecker CI](https://woodpecker-ci.org) plugin for [buildctl](https://github.com/moby/buildkit) to build container images using a remote buildkit instance.
|
||||
A [Woodpecker CI](https://woodpecker-ci.org) plugin for [buildctl](https://github.com/moby/buildkit) to build container images using a remote buildkit host.
|
||||
Also usable with Gitlab, Github or locally, see examples for usage.
|
||||
|
||||
## Features
|
||||
|
||||
- preconfigure buildctl parameters
|
||||
- preconfigured for [reproduceable builds](https://github.com/moby/buildkit/blob/master/docs/build-repro.md)
|
||||
- runnable with local docker daemon
|
||||
|
||||
## Example
|
||||
|
@ -23,13 +23,15 @@ Woodpecker:
|
|||
steps:
|
||||
buildctl:
|
||||
image: kokuwaio/buildctl
|
||||
depends_on: []
|
||||
settings:
|
||||
no-warnings: true
|
||||
format: json
|
||||
when:
|
||||
event: pull_request
|
||||
path: [.buildctl.yaml, "**/*.y*ml"]
|
||||
name:
|
||||
- registry.example.org/foo:latest
|
||||
- registry.example.org/foo:0.0.1
|
||||
annotation:
|
||||
org.opencontainers.image.title: My Image
|
||||
org.opencontainers.image.description: A description.
|
||||
platform: [linux/amd64, linux/arm64]
|
||||
auth: {from_secret: AUTH}
|
||||
```
|
||||
|
||||
Gitlab:
|
||||
|
@ -40,34 +42,45 @@ buildctl:
|
|||
needs: []
|
||||
image: kokuwaio/buildctl
|
||||
variables:
|
||||
PLUGIN_NO_WARNINGS: true
|
||||
PLUGIN_FORMAT: json
|
||||
PLUGIN_ADDR: tcp://0.8.1.5:1234
|
||||
PLUGIN_NAME: registry.example.org/foo:latest,registry.example.org/foo:0.0.1
|
||||
PLUGIN_PLATFORM: linux/amd64,linux/arm64
|
||||
PLUGIN_AUTH: '{"auths":{"registry.example.org":{"auth":"changeMe}}}'
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
changes: [.buildctl.yaml, "**/*.y*ml"]
|
||||
```
|
||||
|
||||
CLI:
|
||||
CLI (will reuse docker credentials of current user):
|
||||
|
||||
```bash
|
||||
docker run --rm --volume=$(pwd):$(pwd):ro --workdir=$(pwd) kokuwaio/buildctl --no-warnings --format=json
|
||||
PLUGIN_ADDR=tcp://0.8.1.5:1234
|
||||
PLUGIN_NAME=registry.example.org/foo:latest,registry.example.org/foo:0.0.1
|
||||
PLUGIN_PLATFORM=linux/amd64,linux/arm64
|
||||
docker run --rm --user=$(id -u) --volume=$HOME:$HOME:ro --workdir=$PWD --env=PLUGIN_ADDR --env=PLUGIN_NAME --env=PLUGIN_PLATFORM kokuwaio/buildctl
|
||||
```
|
||||
|
||||
## Settings
|
||||
|
||||
| Settings Name | Environment | Default | Description |
|
||||
| --------------| ------------------ | --------- | -------------------------------------------------------------------- |
|
||||
| `config-file` | PLUGIN_CONFIG_FILE | `none` | Configuration file to use, if none is configured [default](https://buildctl.readthedocs.io/en/stable/configuration.html) is used |
|
||||
| `strict` | PLUGIN_STRICT | `true` | Fail on warnings |
|
||||
| `no-warnings` | PLUGIN_NO_WARNINGS | `false` | Output only error level problems |
|
||||
| `format` | PLUGIN_FORMAT | `colored` | Format for parsing output: parsable, standard, colored, github, auto |
|
||||
| Settings Name | Environment | Default | Description |
|
||||
| ------------------- | ------------------------ | ---------------- | ----------------------------------------------------------------------------------------------- |
|
||||
| `addr` | PLUGIN_ADDR | `$BUILDKIT_HOST` | Buildkit host to use. |
|
||||
| `frontend` | PLUGIN_FRONTEND | `dockerfile.v0` | Only dockerfile frontend supported right now |
|
||||
| `context` | PLUGIN_CONTEXT | `$PWD` | Context directory to use for build |
|
||||
| `dockerfile` | PLUGIN_DOCKERFILE | `Dockerfile` | Dockerfile to use. |
|
||||
| `platform` | PLUGIN_PLATFORM | `none` | Target platform for container image. |
|
||||
| `source-epoch-date` | PLUGIN_SOURCE_DATE_EPOCH | `0` | Target platform for container image. |
|
||||
| `name` | PLUGIN_NAME | `none` | Images names where to push the image. |
|
||||
| `annotation` | PLUGIN_ANNOTATION | `none` | Annotations (also known as labels) to add to image |
|
||||
| `auth` | PLUGIN_AUTH | `none` | Auth for private registries, see [](https://github.com/moby/buildkit?tab=readme-ov-file#output) |
|
||||
| `push` | PLUGIN_PUSH | `true` | Push images if output names are set. |
|
||||
|
||||
## Alternatives
|
||||
|
||||
| Image | Comment | amd64 | arm64 |
|
||||
| ----------------------------------------------------------------------------------- | --------------------------------- |:-----:|:-----:|
|
||||
| [kokuwaio/buildctl](https://hub.docker.com/r/kokuwaio/buildctl) | Woodpecker plugin | [](https://hub.docker.com/repository/docker/kokuwaio/buildctl) | [](https://hub.docker.com/repository/docker/kokuwaio/buildctl) |
|
||||
| [pipelinecomponents/buildctl](https://hub.docker.com/r/pipelinecomponents/buildctl) | not a Woodpecker plugin | [](https://hub.docker.com/repository/docker/pipelinecomponents/buildctl) | [](https://hub.docker.com/repository/docker/pipelinecomponents/buildctl) |
|
||||
| [giantswarm/buildctl](https://hub.docker.com/r/giantswarm/buildctl) | not a Woodpecker plugin | [](https://hub.docker.com/repository/docker/giantswarm/buildctl) | [](https://hub.docker.com/repository/docker/giantswarm/buildctl) |
|
||||
| [cytopia/buildctl](https://hub.docker.com/r/sdesbure/buildctl) | not a Woodpecker plugin, outdated | [](https://hub.docker.com/repository/docker/cytopia/buildctl) | [](https://hub.docker.com/repository/docker/cytopia/buildctl) |
|
||||
| [sdesbure/buildctl](https://hub.docker.com/r/sdesbure/buildctl) | not a Woodpecker plugin, outdated | [](https://hub.docker.com/repository/docker/sdesbure/buildctl) | [](https://hub.docker.com/repository/docker/sdesbure/buildctl) |
|
||||
| Image | Comment | amd64 | arm64 |
|
||||
| --------------------------------------------------------------- | --------------------------------- |:-----:|:-----:|
|
||||
| [kokuwaio/buildctl](https://hub.docker.com/r/kokuwaio/buildctl) | Woodpecker plugin | [](https://hub.docker.com/repository/docker/kokuwaio/buildctl) | [](https://hub.docker.com/repository/docker/kokuwaio/buildctl) |
|
||||
| [moby/buildkit](https://hub.docker.com/r/moby/buildkit) | not a Woodpecker plugin | [](https://hub.docker.com/repository/docker/moby/buildkit) | [](https://hub.docker.com/repository/docker/moby/buildkit) |
|
||||
| [nordseth/buildctl](https://hub.docker.com/r/nordseth/buildctl) | not a Woodpecker plugin | [](https://hub.docker.com/repository/docker/nordseth/buildctl) | [](https://hub.docker.com/repository/docker/nordseth/buildctl) |
|
||||
| [shopstic/buildctl](https://hub.docker.com/r/shopstic/buildctl) | not a Woodpecker plugin, outdated | [](https://hub.docker.com/repository/docker/shopstic/buildctl) | [](https://hub.docker.com/repository/docker/shopstic/buildctl) |
|
||||
| [agisoft/buildctl](https://hub.docker.com/r/agisoft/buildctl) | not a Woodpecker plugin, outdated | [](https://hub.docker.com/repository/docker/agisoft/buildctl) | [](https://hub.docker.com/repository/docker/agisoft/buildctl) |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue