drone-docker/_docs/content/_index.md

84 lines
2.5 KiB
Markdown
Raw Normal View History

---
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.
<!-- 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
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.
2021-09-11 11:27:00 +00:00
2022-05-29 21:37:56 +00:00
## Usage
{{< hint type=important >}}
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.
{{< /hint >}}
2022-05-29 21:37:56 +00:00
```YAML
kind: pipeline
name: default
steps:
- name: docker
image: thegeeklab/drone-docker
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 -->
{{< propertylist name=drone-docker.data >}}
<!-- spellchecker-enable -->
<!-- prettier-ignore-end -->
## 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
```
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
```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
```