drone-docker/_docs/content/_index.md

2.5 KiB

title
drone-docker

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

Drone plugin to build and publish multiarch Docker images.

{{< toc >}}

Versioning

The tags follow the major version of Docker, e.g. 19, the minor and patch part reflects the "version" of the plugin. A full example would be 19.6.5. Minor versions may introduce breaking changes, while patch versions may 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
    privileged: true
    settings:
      username: octocat
      password: secure
      repo: octocat/example
      tags: latest

Parameters

{{< propertylist name=drone-docker.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 .

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 --dry-run