From c78243d90e6a2c1bb32e72abe82c3a4947d7cf58 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sat, 11 Sep 2021 20:58:07 +0200 Subject: [PATCH] add missing parts for external docs --- .dictionary | 12 +++ .drone.jsonnet | 61 ++++++++++++++- .github/settings.yml | 10 +++ .markdownlint.yml | 6 ++ README.md | 38 +--------- _docs/_index.md | 171 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 259 insertions(+), 39 deletions(-) create mode 100644 .dictionary create mode 100644 .markdownlint.yml create mode 100644 _docs/_index.md diff --git a/.dictionary b/.dictionary new file mode 100644 index 0000000..b516618 --- /dev/null +++ b/.dictionary @@ -0,0 +1,12 @@ +url +ip +mtu +dns +ipv6 +dockerfile +og +gzip +json +config +host:ip +multiarch diff --git a/.drone.jsonnet b/.drone.jsonnet index 928ee35..923e02e 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -235,6 +235,61 @@ local PipelineBuildContainer(arch='amd64') = { }, }; +local PipelineDocs = { + kind: 'pipeline', + name: 'docs', + platform: { + os: 'linux', + arch: 'amd64', + }, + concurrency: { + limit: 1, + }, + steps: [ + { + name: 'markdownlint', + image: 'thegeeklab/markdownlint-cli', + commands: [ + "markdownlint 'docs/content/**/*.md' 'README.md' 'CONTRIBUTING.md'", + ], + }, + { + name: 'spellcheck', + image: 'node:lts-alpine', + commands: [ + 'npm install -g spellchecker-cli', + "spellchecker --files '_docs/**/*.md' 'README.md' 'CONTRIBUTING.md' -d .dictionary -p spell indefinite-article syntax-urls --no-suggestions", + ], + environment: { + FORCE_COLOR: true, + NPM_CONFIG_LOGLEVEL: 'error', + }, + }, + { + name: 'publish', + image: 'plugins/gh-pages', + settings: { + username: { from_secret: 'github_username' }, + password: { from_secret: 'github_token' }, + pages_directory: '_docs/', + target_branch: 'docs', + }, + when: { + ref: ['refs/heads/main'], + }, + }, + ], + depends_on: [ + 'build-binaries', + 'build-container-amd64', + 'build-container-arm64', + 'build-container-arm', + ], + trigger: { + ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'], + }, +}; + local PipelineNotifications = { kind: 'pipeline', image_pull_secrets: ['docker_config'], @@ -320,9 +375,7 @@ local PipelineNotifications = { }, ], depends_on: [ - 'build-binaries', - 'build-container-amd64', - 'build-container-arm64', + 'docs', ], trigger: { ref: ['refs/heads/main', 'refs/tags/**'], @@ -335,5 +388,7 @@ local PipelineNotifications = { PipelineBuildBinaries, PipelineBuildContainer(arch='amd64'), PipelineBuildContainer(arch='arm64'), + PipelineBuildContainer(arch='arm'), + PipelineDocs, PipelineNotifications, ] diff --git a/.github/settings.yml b/.github/settings.yml index 396906d..ab36ba6 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -1,6 +1,7 @@ repository: name: drone-docker-buildx description: Drone plugin to build multiarch Docker images with buildx + homepage: https://drone-plugin-index.geekdocs.de/plugins/drone-docker-buildx topics: drone, drone-plugin private: false @@ -53,3 +54,12 @@ branches: - continuous-integration/drone/pr enforce_admins: null restrictions: null + - name: docs + protection: + required_pull_request_reviews: null + required_status_checks: null + enforce_admins: true + restrictions: + users: [] + teams: + - bot diff --git a/.markdownlint.yml b/.markdownlint.yml new file mode 100644 index 0000000..b59a114 --- /dev/null +++ b/.markdownlint.yml @@ -0,0 +1,6 @@ +--- +default: True +MD013: False +MD041: False +MD004: + style: dash diff --git a/README.md b/README.md index 4f244a4..b7f5fb9 100644 --- a/README.md +++ b/README.md @@ -10,46 +10,12 @@ Drone plugin to build multiarch Docker images with buildx [![Source: GitHub](https://img.shields.io/badge/source-github-blue.svg?logo=github&logoColor=white)](https://github.com/thegeeklab/drone-docker-buildx) [![License: MIT](https://img.shields.io/github/license/thegeeklab/drone-docker-buildx)](https://github.com/thegeeklab/drone-docker-buildx/blob/main/LICENSE) -Drone plugin to build multiarch Docker images with buildx. This plugin is a fork of [drone-plugins/drone-docker](https://github.com/drone-plugins/drone-docker). +Drone plugin to build multiarch Docker images with buildx. This plugin is a fork of [drone-plugins/drone-docker](https://github.com/drone-plugins/drone-docker). You can find the full documentation at You can find the full documentation at [https://drone-plugin-index.geekdocs.de](https://drone-plugin-index.geekdocs.de/plugins/drone-docker-buildx). -## Docker Tags +## Versioning Tags are following the main Docker version e.g. `20.10`, the second part is reflecting the plugin "version". A full example would be `20.10.5`. -## Build - -Build the binary with the following command: - -```Shell -export GOOS=linux -export GOARCH=amd64 -export CGO_ENABLED=0 -export GO111MODULE=on - -go build -v -a -tags netgo -o release/drone-docker-buildx -``` - -Build the Docker image with the following command: - -```Shell -docker build --file docker/Dockerfile.amd64 --tag thegeeklab/drone-docker-buildx . -``` - -## Usage - -> Notice: Be aware that the tis plugin requires privileged capabilities, otherwise the integrated Docker daemon is not able to start. - -```console -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 -``` - ## Community diff --git a/_docs/_index.md b/_docs/_index.md new file mode 100644 index 0000000..edc4115 --- /dev/null +++ b/_docs/_index.md @@ -0,0 +1,171 @@ +--- +title: drone-docker-buildx +--- + +[![Build Status](https://img.shields.io/drone/build/thegeeklab/drone-docker-buildx?logo=drone&server=https%3A%2F%2Fdrone.thegeeklab.de)](https://drone.thegeeklab.de/thegeeklab/drone-docker-buildx) +[![Docker Hub](https://img.shields.io/badge/dockerhub-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/drone-docker-buildx) +[![Quay.io](https://img.shields.io/badge/quay-latest-blue.svg?logo=docker&logoColor=white)](https://quay.io/repository/thegeeklab/drone-docker-buildx) +[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/drone-docker-buildx)](https://github.com/thegeeklab/drone-docker-buildx/graphs/contributors) +[![Source: GitHub](https://img.shields.io/badge/source-github-blue.svg?logo=github&logoColor=white)](https://github.com/thegeeklab/drone-docker-buildx) +[![License: MIT](https://img.shields.io/github/license/thegeeklab/drone-docker-buildx)](https://github.com/thegeeklab/drone-docker-buildx/blob/main/LICENSE) + + + +{{< toc >}} + + + +## Versioning + +Tags are following the main Docker version e.g. `20.10`, the second part is reflecting the plugin "version". A full example would be `20.10.5`. + +## Build + +Build the binary with the following command: + +```Shell +export GOOS=linux +export GOARCH=amd64 +export CGO_ENABLED=0 +export GO111MODULE=on + +go build -v -a -tags netgo -o release/drone-docker-buildx +``` + +Build the Docker image with the following command: + +```Shell +docker build --file docker/Dockerfile.amd64 --tag thegeeklab/drone-docker-buildx . +``` + +## Usage + +{{< hint warning >}} +**Note**\ +Be aware that the this plugin requires privileged capabilities, otherwise the +integrated Docker daemon is not able to start. +{{< /hint >}} + +```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-buildx --dry-run +``` + +### Parameters + +dry_run +: disables docker push + +drone_remote_url +: sets the git remote url + +mirror +: sets a registry mirror to pull images + +storage_driver +: sets the docker daemon storage driver + +storage_path +: sets the docker daemon storage path (default `/var/lib/docker`) + +bip +: allows the docker daemon to bride ip address + +mtu +: sets docker daemon custom mtu setting + +custom_dns +: sets custom docker daemon dns server + +custom_dns_search +: sets custom docker daemon dns search domain + +insecure +: allows the docker daemon to use insecure registries + +ipv6 +: enables docker daemon ipv6 support + +experimental +: enables docker daemon experimental mode + +debug +: enables verbose debug mode for the docker daemon + +daemon_off +: disables the startup of the docker daemon + +buildkit_config +: sets content of the docker buildkit json config + +dockerfile +: sets dockerfile to use for the image build (default `./Dockerfile`) + +context +: sets the path of the build context to use (default `./`) + +tags +: sets repository tags to use for the image; tags can also be loaded from a `.tags` file (default `latest`) + +auto_tag +: generates tag names automatically based on git branch and git tag + +auto_tag_suffix +: generates tag names with the given suffix + +build_args +: sets custom build arguments for the build + +build_args_from_env +: forwards environment variables as custom arguments to the build + +quiet +: enables suppression of the build output + +target +: sets the build target to use + +cache_from +: sets images to consider as cache sources + +pull_image +: enforces to pull base image at build time (default `true`) + +compress +: enables compression og the build context using gzip + +repo +: sets repository name for the image + +registry +: sets docker registry to authenticate with (default `https://index.docker.io/v1/`) + +username +: sets username to authenticates with + +password +: sets password to authenticates with + +email +: sets email addres to authenticates with + +config +: sets content of the docker daemon json config + +purge +: enables cleanup of the docker environment at the end of a build (default `true`) + +no_cache +: disables the usage of cached intermediate containers + +add_host +: sets additional host:ip mapping + +platforms +: sets target platform for build