2021-09-11 10:40:31 +00:00
---
title: drone-docker
---
2021-09-11 11:27:00 +00:00
[![Build Status ](https://img.shields.io/drone/build/thegeeklab/drone-docker?logo=drone&server=https%3A%2F%2Fdrone.thegeeklab.de )](https://drone.thegeeklab.de/thegeeklab/drone-docker)
[![Docker Hub ](https://img.shields.io/badge/dockerhub-latest-blue.svg?logo=docker&logoColor=white )](https://hub.docker.com/r/thegeeklab/drone-docker)
[![Quay.io ](https://img.shields.io/badge/quay-latest-blue.svg?logo=docker&logoColor=white )](https://quay.io/repository/thegeeklab/drone-docker)
[![GitHub contributors ](https://img.shields.io/github/contributors/thegeeklab/drone-docker )](https://github.com/thegeeklab/drone-docker/graphs/contributors)
[![Source: GitHub ](https://img.shields.io/badge/source-github-blue.svg?logo=github&logoColor=white )](https://github.com/thegeeklab/drone-docker)
[![License: MIT ](https://img.shields.io/github/license/thegeeklab/drone-docker )](https://github.com/thegeeklab/drone-docker/blob/main/LICENSE)
2021-09-11 19:30:19 +00:00
Drone plugin to build and publish multiarch Docker images.
2021-09-11 10:40:31 +00:00
<!-- prettier - ignore - start -->
<!-- spellchecker - disable -->
{{< toc > }}
<!-- spellchecker - enable -->
<!-- prettier - ignore - end -->
2021-09-11 11:32:55 +00:00
## Versioning
2021-09-11 11:27:00 +00:00
2022-07-12 07:12:30 +00:00
The tags follow the major version of Docker, e.g. `19` , and the minor and patch parts reflect the `version` of the plugin. A full example would be `19.6.5` . Minor versions can introduce breaking changes, while patch versions can be considered non-breaking.
2021-09-11 11:27:00 +00:00
2022-05-29 21:37:56 +00:00
## Usage
2022-05-30 19:59:44 +00:00
{{< hint type = important > }}
2022-06-02 20:05:53 +00:00
Be aware that the this plugin requires [privileged ](https://docs.drone.io/pipeline/docker/syntax/steps/#privileged-mode ) capabilities, otherwise the integrated Docker daemon is not able to start.
2022-05-30 19:59:44 +00:00
{{< / hint > }}
2022-05-29 21:37:56 +00:00
```YAML
kind: pipeline
name: default
steps:
- name: docker
image: thegeeklab/drone-docker
2022-06-02 20:05:53 +00:00
privileged: true
2022-05-29 21:37:56 +00:00
settings:
username: octocat
password: secure
repo: octocat/example
tags: latest
```
### Parameters
<!-- prettier - ignore - start -->
<!-- spellchecker - disable -->
2022-11-24 14:09:19 +00:00
{{< propertylist name = drone-docker.data sort = name > }}
2022-05-29 21:37:56 +00:00
<!-- spellchecker - enable -->
<!-- prettier - ignore - end -->
2021-09-11 10:40:31 +00:00
## Build
Build the binary with the following command:
```Shell
export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0
export GO111MODULE=on
2022-04-25 10:48:52 +00:00
make build
2021-09-11 10:40:31 +00:00
```
Build the Docker image with the following command:
```Shell
docker build --file docker/Dockerfile.amd64 --tag thegeeklab/drone-docker .
```
2022-05-29 21:37:56 +00:00
## Test
2021-09-11 10:40:31 +00:00
```Shell
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
```