wp-docker-buildx
Woodpecker CI plugin to build multiarch OCI images with buildx.
Be aware that the this plugin requires privileged capabilities, otherwise the integrated Docker daemon is not able to start.
steps:
- name: docker
image: quay.io/thegeeklab/wp-docker-buildx
privileged: true
settings:
username: octocat
password: random-secret
repo: octocat/example
tags: latest
-
Additional
host:ip
mapping.Default: none -
Generate tag names automatically based on git branch and git tag.
When this feature is enabled and the event type is
tag
, the plugin will automatically tag the image using the standard semVer convention. For example:1.0.0
produces docker tags1
,1.0
,1.0.0
1.0.0-rc.1
produces docker tags1.0.0-rc.1
When the event type ispush
and the target branch is your default branch, the plugin will automatically tag the image aslatest
. All other event types and branches are ignored.
Default: false -
Generate tag names with the given suffix.Default: none
-
Allow the docker daemon to bride IP address.Default: none
-
Custom build arguments for the build. Example:
steps: - name: Build image: quay.io/thegeeklab/wp-docker-buildx settings: repo: example/repo build_args: FOO: bar API_KEY: from_secret: API_KEY
Default: none -
Forward environment variables to the build as build arguments. If the same key already exists in
build_args
, it will not be overwritten. Example:steps: - name: Build image: quay.io/thegeeklab/wp-docker-buildx settings: repo: example/repo build_args_from_env: - CI_COMMIT_SHA
Default: none -
Content of the docker buildkit toml config. Example:
steps: - name: Build image: quay.io/thegeeklab/wp-docker-buildx settings: repo: example/repo buildkit_config: | [registry."registry.local:30081"] http = true insecure = true
Default: none -
Images to consider as cache sources. To properly work, commas used in the cache source entries need to be escaped:
steps: - name: Build image: quay.io/thegeeklab/wp-docker-buildx settings: repo: example/repo cache_from: # while using quotes, double-escaping is required - "type=registry\\\\,ref=example" - 'type=foo\\,ref=bar'
Default: none -
Cache destination for the build cache.Default: none
-
Enable compression of the build context using gzip.Default: false
-
Containerfile to use for the image build.Default: Containerfile
-
Path of the build context.Default: .
-
Custom docker daemon dns server.Default: none
-
Custom docker daemon dns search domain.Default: none
-
Disable the startup of the docker daemon.Default: false
-
Enable verbose debug mode for the docker daemon.Default: false
-
Disable docker push.Default: false
-
Email address for registry authentication.Default: $DOCKER_EMAIL
-
Enable docker daemon experimental mode.Default: false
-
Additional tags to use for the image including registry.
Additional tags can also be loaded from an
.extratags
file. This function can be used to push images to multiple registries at once. Therefore, it is necessary to use theconfig
flag to provide a configuration file that contains the authentication information for all used registries.Default: none -
Allow the docker daemon to use insecure registries.Default: false
-
Skip SSL verification.Default: false
-
Enable docker daemon IPv6 support.Default: false
-
Labels to add to image.Default: none
-
Plugin log level.Default: info
-
Max concurrent uploads for each push.
By default the Docker daemon will push five layers of an image at a time. If you are on a low bandwidth connection this may cause timeout issues and you may want to lower with this option.
Default: none -
Registry mirror to pull images.Default: $DOCKER_PLUGIN_MIRROR
-
Docker daemon custom MTU setting.Default: none
-
Additional named build contexts (format:
name=path
).Default: none -
Disable the usage of cached intermediate containers.Default: false
-
Default: none
-
Password for registry authentication.Default: $DOCKER_PASSWORD
-
Target platform for build.Default: none
-
Generate provenance attestation for the build (shorthand for
--attest=type=provenance
).Default: none -
Enforce to pull base image at build time.Default: true
-
Enable suppression of the build output.Default: false
-
Docker registry to authenticate with.Default: https://index.docker.io/v1/
-
Content of the registry credentials store file.Default: $DOCKER_REGISTRY_CONFIG
-
Repository name for the image.
If the image is to be pushed to registries other than the default DockerHub, it is necessary to set
repo
as fully-qualified name.Default: none -
Generate SBOM attestation for the build (shorthand for
--attest type=sbom
).Default: none -
Exposes secrets to the build. The secrets can be used by the build using
RUN --mount=type=secret
mount.steps: - name: Build image: quay.io/thegeeklab/wp-docker-buildx privileged: true environment: SECURE_TOKEN: from_secret: secure_token settings: secrets: # while using quotes, double-escaping is required - "id=raw_file_secret\\\\,src=file.txt" - 'id=other_raw_file_secret\\,src=other_file.txt' - "id=SECRET_TOKEN"
To use secrets from files a host volume is required. This should be used with caution and avoided whenever possible.
Default: none -
Docker daemon storage driver.Default: none
-
Docker daemon storage path.Default: /var/lib/docker
-
Repository tags to use for the image.
Tags can also be loaded from a
.tags
file.Default: none -
Build target to use.Default: none
-
Username for registry authentication.Default: $DOCKER_USERNAME
If the created image is to be pushed to registries other than the default DockerHub, it is necessary to set registry
and repo
as fully-qualified name.
GHCR:
steps:
- name: docker
image: quay.io/thegeeklab/wp-docker-buildx
privileged: true
settings:
registry: ghcr.io
username: octocat
password: secret-access-token
repo: ghcr.io/octocat/example
tags: latest
AWS ECR:
steps:
- name: docker
image: quay.io/thegeeklab/wp-docker-buildx
privileged: true
environment:
AWS_ACCESS_KEY_ID:
from_secret: aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: aws_secret_access_key
settings:
registry: <account_id>.dkr.ecr.<region>.amazonaws.com
repo: <account_id>.dkr.ecr.<region>.amazonaws.com/octocat/example
tags: latest
Build the binary with the following command:
make build
Build the container image with the following command:
docker build --file Containerfile.multiarch --tag thegeeklab/wp-docker-buildx .
docker run --rm \
-e PLUGIN_TAG=latest \
-e PLUGIN_REPO=octocat/hello-world \
-e CI_COMMIT_SHA=00000000 \
-v $(pwd)/testdata:/build:z \
-w /build \
--privileged \
thegeeklab/wp-docker-buildx --dry-run