drone-docker-buildx/content/_index.md
renovate[bot] 6a7daf03a2 commit 25bcaaebe0
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Tue Jul 12 16:40:05 2022 +0200

    fix(deps): update module github.com/thegeeklab/drone-plugin-lib/v2 to v2.0.2 (#111)
2022-07-12 14:51:20 +00:00

2.7 KiB

title
drone-docker-buildx

Build Status Docker Hub Quay.io GitHub contributors Source: GitHub License: MIT

Drone plugin to build and publish multiarch Docker images with buildx.

{{< toc >}}

Versioning

The tags follow the major version of Docker, e.g. 20, and the minor and patch parts reflect the version of the plugin. A full example would be 20.12.5. Minor versions can introduce breaking changes, while patch versions can be considered non-breaking.

Usage

{{< hint type=important >}} Be aware that the this plugin requires privileged capabilities, otherwise the integrated Docker daemon is not able to start. {{< /hint >}}

kind: pipeline
name: default

steps:
  - name: docker
    image: thegeeklab/drone-docker-buildx
    privileged: true
    settings:
      username: octocat
      password: secure
      repo: octocat/example
      tags: latest

Parameters

{{< propertylist name=drone-docker-buildx.data >}}

Build

Build the binary with the following command:

export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0
export GO111MODULE=on

make build

Build the Docker image with the following command:

docker build --file docker/Dockerfile.amd64 --tag thegeeklab/drone-docker-buildx .

Test

docker run --rm \
  -e PLUGIN_TAG=latest \
  -e PLUGIN_REPO=octocat/hello-world \
  -e DRONE_COMMIT_SHA=00000000 \
  -v $(pwd):$(pwd) \
  -w $(pwd) \
  --privileged \
  thegeeklab/drone-docker-buildx --dry-run