kokuwaio/buildctl

By kokuwaio

Updated 3 days ago

A WoodpeckerCI plugin for buildctl to build container images using a remote builtkitd instance.

Image
Integration & delivery
Developer tools
0

10K+

kokuwaio/buildctl repository overview

Buildctl WoodpeckerCI Plugin

pulls size dockerfile license prs issues

A WoodpeckerCI plugin for buildctl to build container images using a remote buildkit host.
Also usable with Gitlab, Github or locally, see examples for usage.

Features

Example

WoodpeckerCI:

steps:
  buildctl:
    depends_on: []
    image: kokuwaio/buildctl:v0.29.0
    settings:
      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.
      build-args:
        NPM_CONFIG_REGISTRY: ${NPM_CONFIG_REGISTRY} # reused from ci env
        FOO: bar
      platform: [linux/amd64, linux/arm64]
      auth:
        registry.example.org:
          username: {from_secret: my_username}
          password: {from_secret: my_password}
        https://index.docker.io/v1/":
          username: {from_secret: docker_io_username}
          password: {from_secret: docker_io_password}

Gitlab: (using script is needed because of https://gitlab.com/gitlab-org/gitlab/-/issues/19717)

buildctl:
  needs: []
  stage: lint
  image:
    name: kokuwaio/buildctl:v0.29.0
    entrypoint: [""]
  script: /usr/local/bin/entrypoint.sh
  variables:
    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: '{"registry.example.org":{"username":"my-user","password":"changeMe"}}'
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"

CLI (will reuse docker credentials of current user):

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 NameEnvironmentDefaultDescription
addrPLUGIN_ADDR$BUILDKIT_HOSTBuildkit host to use.
frontendPLUGIN_FRONTENDdockerfile.v0Only dockerfile frontend supported right now
contextPLUGIN_CONTEXT$PWDContext directory to use for build
dockerfilePLUGIN_DOCKERFILEDockerfileDockerfile to use.
targetPLUGIN_TARGETnoneDockerfile target
build-argsPLUGIN_BUILD_ARGSnoneBuild args to pass to build
platformPLUGIN_PLATFORMnoneTarget platform for container image.
reproduciblePLUGIN_REPRODUCIBLEtrueBuild with reproducible settings.
source-date-epochPLUGIN_SOURCE_DATE_EPOCH0Timestamp to use for reproducible builds.
namePLUGIN_NAMEnoneImages names where to push the image.
annotationPLUGIN_ANNOTATIONnoneAnnotations (also known as labels) to add to image
pushPLUGIN_PUSHtruePush images if output names are set.
authPLUGIN_AUTHnoneAuth for private registries
env-filePLUGIN_ENV_FILEnoneSource environment values from given file

Alternatives

ImageCommentamd64arm64
kokuwaio/buildctlWoodpecker pluginsizesize
moby/buildkitnot a Woodpecker pluginsizesize
nordseth/buildctlnot a Woodpecker pluginsizesize
shopstic/buildctlnot a Woodpecker plugin, outdatedsizesize
agisoft/buildctlnot a Woodpecker plugin, outdatedsizesize
tikivn/buildctlnot a Woodpecker plugin, outdatedsizesize

Tag summary

Content type

Image

Digest

sha256:b81fe08cc

Size

23.4 MB

Last updated

3 days ago

docker pull kokuwaio/buildctl