Compare commits

...

19 Commits

Author SHA1 Message Date
Robert Kaussow c9b8ea3c6a
chore: add deprecation notice 2023-01-15 21:58:39 +01:00
renovate[bot] 2c152cce3c chore(docker): update docker digests 2023-01-10 07:30:19 +00:00
Robert Kaussow 63baa5cc0d
ci: bump docker plugin to v20 (#76) 2023-01-08 15:44:10 +01:00
renovate[bot] e35e3f6208
chore(deps): update arm64v8/docker docker tag to v20 (#17) 2023-01-07 17:42:26 +01:00
renovate[bot] 9bef137ed6
chore(deps): update docker docker tag to v20 (#24) 2023-01-07 17:42:18 +01:00
Robert Kaussow fbc9427cda
chore: remove support for arm32 (#75) 2023-01-07 17:36:00 +01:00
Robert Kaussow 5303f6a5ca
docs: add example for custom registires (#74) 2022-12-21 10:49:07 +01:00
renovate[bot] dd6fc6ce42
fix(deps): update module github.com/thegeeklab/drone-plugin-lib/v2 to v2.2.1 (#73) 2022-12-21 08:45:23 +01:00
renovate[bot] dd65477400
fix(deps): update module github.com/urfave/cli/v2 to v2.23.7 (#72) 2022-12-20 21:06:38 +01:00
Robert Kaussow 5848ea5719
docs: fix properties file syntax due to changes in the theme (#71) 2022-11-24 15:09:19 +01:00
renovate[bot] 9b558675eb
fix(deps): update module github.com/urfave/cli/v2 to v2.23.5 (#69) 2022-11-24 09:45:56 +01:00
Robert Kaussow 81094ee3c5
ci: create symlink for xgo source directory (#70) 2022-11-24 09:43:43 +01:00
renovate[bot] 0e88134cab
fix(deps): update module github.com/thegeeklab/drone-plugin-lib/v2 to v2.2.0 (#68) 2022-10-31 19:59:29 +01:00
renovate[bot] d9a5ee9d4f
fix(deps): update module github.com/urfave/cli/v2 to v2.23.0 (#63) 2022-10-31 12:44:42 +01:00
renovate[bot] afe0ab1105 chore(deps): update dependency golangci/golangci-lint to v1.50.1 2022-10-24 04:56:18 +00:00
renovate[bot] c77d8d07b7 chore(deps): update dependency golangci/golangci-lint to v1.50.0 2022-10-10 04:57:50 +00:00
renovate[bot] 76e1cc61ec chore(deps): update dependency mvdan/gofumpt to v0.4.0 2022-10-03 04:28:36 +00:00
renovate[bot] 15da7b71db chore(deps): update dependency golangci/golangci-lint to v1.49.0 2022-08-29 05:46:08 +00:00
renovate[bot] afaaed742d chore(deps): update dependency golangci/golangci-lint to v1.48.0 2022-08-08 04:30:50 +00:00
14 changed files with 86 additions and 167 deletions

View File

@ -10,3 +10,4 @@ json
config
host:ip
multiarch
DockerHub

View File

@ -70,6 +70,7 @@ local PipelineBuildBinaries = {
name: 'build',
image: 'techknowlogick/xgo:go-1.19.x',
commands: [
'ln -s /drone/src /source',
'make release',
],
},
@ -140,7 +141,7 @@ local PipelineBuildContainer(arch='amd64') = {
},
{
name: 'dryrun',
image: 'thegeeklab/drone-docker:19',
image: 'thegeeklab/drone-docker:20',
settings: {
dry_run: true,
dockerfile: 'docker/Dockerfile.' + arch,
@ -153,7 +154,7 @@ local PipelineBuildContainer(arch='amd64') = {
},
{
name: 'publish-dockerhub',
image: 'thegeeklab/drone-docker:19',
image: 'thegeeklab/drone-docker:20',
settings: {
auto_tag: true,
auto_tag_suffix: arch,
@ -169,7 +170,7 @@ local PipelineBuildContainer(arch='amd64') = {
},
{
name: 'publish-quay',
image: 'thegeeklab/drone-docker:19',
image: 'thegeeklab/drone-docker:20',
settings: {
auto_tag: true,
auto_tag_suffix: arch,
@ -240,7 +241,6 @@ local PipelineDocs = {
'build-binaries',
'build-container-amd64',
'build-container-arm64',
'build-container-arm',
],
trigger: {
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
@ -344,7 +344,6 @@ local PipelineNotifications = {
PipelineBuildBinaries,
PipelineBuildContainer(arch='amd64'),
PipelineBuildContainer(arch='arm64'),
PipelineBuildContainer(arch='arm'),
PipelineDocs,
PipelineNotifications,
]

View File

@ -53,6 +53,7 @@ steps:
- name: build
image: techknowlogick/xgo:go-1.19.x
commands:
- ln -s /drone/src /source
- make release
- name: executable
@ -110,7 +111,7 @@ steps:
- make build
- name: dryrun
image: thegeeklab/drone-docker:19
image: thegeeklab/drone-docker:20
settings:
dockerfile: docker/Dockerfile.amd64
dry_run: true
@ -122,7 +123,7 @@ steps:
- build
- name: publish-dockerhub
image: thegeeklab/drone-docker:19
image: thegeeklab/drone-docker:20
settings:
auto_tag: true
auto_tag_suffix: amd64
@ -140,7 +141,7 @@ steps:
- dryrun
- name: publish-quay
image: thegeeklab/drone-docker:19
image: thegeeklab/drone-docker:20
settings:
auto_tag: true
auto_tag_suffix: amd64
@ -182,7 +183,7 @@ steps:
- make build
- name: dryrun
image: thegeeklab/drone-docker:19
image: thegeeklab/drone-docker:20
settings:
dockerfile: docker/Dockerfile.arm64
dry_run: true
@ -194,7 +195,7 @@ steps:
- build
- name: publish-dockerhub
image: thegeeklab/drone-docker:19
image: thegeeklab/drone-docker:20
settings:
auto_tag: true
auto_tag_suffix: arm64
@ -212,7 +213,7 @@ steps:
- dryrun
- name: publish-quay
image: thegeeklab/drone-docker:19
image: thegeeklab/drone-docker:20
settings:
auto_tag: true
auto_tag_suffix: arm64
@ -239,78 +240,6 @@ trigger:
depends_on:
- test
---
kind: pipeline
name: build-container-arm
platform:
os: linux
arch: arm
steps:
- name: build
image: golang:1.19
commands:
- make build
- name: dryrun
image: thegeeklab/drone-docker:19
settings:
dockerfile: docker/Dockerfile.arm
dry_run: true
repo: thegeeklab/${DRONE_REPO_NAME}
when:
ref:
- refs/pull/**
depends_on:
- build
- name: publish-dockerhub
image: thegeeklab/drone-docker:19
settings:
auto_tag: true
auto_tag_suffix: arm
dockerfile: docker/Dockerfile.arm
password:
from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: docker_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- dryrun
- name: publish-quay
image: thegeeklab/drone-docker:19
settings:
auto_tag: true
auto_tag_suffix: arm
dockerfile: docker/Dockerfile.arm
password:
from_secret: quay_password
registry: quay.io
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: quay_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- dryrun
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
depends_on:
- test
---
kind: pipeline
name: docs
@ -359,7 +288,6 @@ depends_on:
- build-binaries
- build-container-amd64
- build-container-arm64
- build-container-arm
---
kind: pipeline
@ -453,6 +381,6 @@ depends_on:
---
kind: signature
hmac: cd4d5a770121306a4d8992ec7135ce43049673eb218b41961645d3f9fd915740
hmac: 2678272f471334df973c0b9c0e8886dcf0941f5581b460b116fb48c88e7a14ba
...

View File

@ -1,7 +1,7 @@
# renovate: datasource=github-releases depName=mvdan/gofumpt
GOFUMPT_PACKAGE_VERSION := v0.3.1
GOFUMPT_PACKAGE_VERSION := v0.4.0
# renovate: datasource=github-releases depName=golangci/golangci-lint
GOLANGCI_LINT_PACKAGE_VERSION := v1.47.2
GOLANGCI_LINT_PACKAGE_VERSION := v1.50.1
EXECUTABLE := drone-docker
@ -20,7 +20,7 @@ XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
GENERATE ?=
XGO_VERSION := go-1.19.x
XGO_TARGETS ?= linux/amd64,linux/arm-6,linux/arm-7,linux/arm64
XGO_TARGETS ?= linux/amd64,linux/arm64
TAGS ?= netgo

View File

@ -1,5 +1,7 @@
# drone-docker
> DISCONTINUED: This image is no longer maintained and will be removed in the future.
Drone plugin to build multiarch Docker images
[![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)

View File

@ -46,10 +46,32 @@ steps:
<!-- prettier-ignore-start -->
<!-- spellchecker-disable -->
{{< propertylist name=drone-docker.data >}}
{{< propertylist name=drone-docker.data sort=name >}}
<!-- spellchecker-enable -->
<!-- prettier-ignore-end -->
### Examples
**Push to other registries than DockerHub:**
If the created image is to be pushed to registries other than the default DockerHub, it is necessary to set `registry` and `repo` as fully-qualified name.
```YAML
kind: pipeline
name: default
steps:
- name: docker
image: thegeeklab/drone-docker
privileged: true
settings:
registry: ghcr.io
username: octocat
password: secret-access-token
repo: ghcr.io/octocat/example
tags: latest
```
## Build
Build the binary with the following command:

View File

@ -1,95 +1,95 @@
---
properties:
dry_run:
- name: dry_run
description: Disable docker push.
type: bool
required: false
mirror:
- name: mirror
description: Use a registry mirror to pull images.
type: string
required: false
storage_driver:
- name: storage_driver
description: The docker daemon storage driver.
type: string
required: false
storage_path:
- name: storage_path
description: The docker daemon storage path.
defaultValue: /var/lib/docker
type: string
required: false
bip:
- name: bip
description: Allows the docker daemon to bride IP address.
type: string
required: false
mtu:
- name: mtu
description: A docker daemon custom MTU.
type: string
required: false
custom_dns:
- name: custom_dns
description: Custom docker daemon DNS server.
type: list
required: false
custom_dns_search:
- name: custom_dns_search
description: Custom docker daemon DNS search domain.
type: list
required: false
insecure:
- name: insecure
description: Enable the usage of insecure registries.
type: bool
defaultValue: false
required: false
ipv6:
- name: ipv6
description: Enable docker daemon IPv6 support.
type: bool
defaultValue: false
required: false
experimental:
- name: experimental
description: Enable docker daemon experimental mode.
type: bool
defaultValue: false
required: false
daemon_debug:
- name: daemon_debug
description: Enable verbose debug mode for the docker daemon.
type: string
defaultValue: false
required: false
daemon_off:
- name: daemon_off
description: Disable the startup of the docker daemon.
type: string
defaultValue: false
required: false
dockerfile:
- name: dockerfile
description: Set dockerfile to use for the image build.
defaultValue: Dockerfile
type: string
required: false
context:
- name: context
description: Set the path of the build context to use.
defaultValue: .
type: string
required: false
tags:
- name: tags
description: Set repository tags to use for the image. Tags can also be loaded from a `.tags` file.
defaultValue: latest
type: list
required: false
auto_tag:
- name: auto_tag
description: |
Generate tag names automatically based on git branch and git tag. When this feature is enabled and the event type is `tag`,
the plugin will automatically tag the image using the standard semVer convention. For example:
@ -103,93 +103,95 @@ properties:
type: bool
required: false
auto_tag_suffix:
- name: auto_tag_suffix
description: Generate tag names with the given suffix.
type: string
required: false
build_args:
- name: build_args
description: Ccustom build arguments to pass to the build.
type: list
required: false
build_args_from_env:
- name: build_args_from_env
description: Forward environment variables as custom arguments to the build.
type: list
required: false
quiet:
- name: quiet
description: Enable suppression of the build output.
defaultValue: false
type: bool
required: false
target:
- name: target
description: The docker build target.
type: string
required: false
cache_from:
- name: cache_from
description: Images to consider as cache sources.
type: list
required: false
pull_image:
- name: pull_image
description: Enforce to pull the base image at build time.
defaultValue: true
type: bool
required: false
compress:
- name: compress
description: Enable compression of the build context using gzip.
defaultValue: false
type: bool
required: false
repo:
description: Repository name for the image.
- name: repo
description: |
Repository name for the image. If the image is to be pushed to registries other than the default DockerHub,
it is necessary to set `repo` as fully-qualified name.
type: string
required: false
registry:
- name: registry
description: Docker registry to upload images.
defaultValue: https://index.docker.io/v1/
type: string
required: false
username:
- name: username
description: Username for authentication with the registry.
type: string
required: false
password:
- name: password
description: Password for authentication with the registry.
type: string
required: false
email:
- name: email
description: E-Mail address for authentication with the registry.
type: string
required: false
config:
- name: config
description: Content of the docker daemon json config.
type: string
required: false
purge:
- name: purge
description: Enable cleanup of the docker environment at the end of a build.
defaultValue: true
type: bool
required: false
no_cache:
- name: no_cache
description: Disable the usage of cached intermediate containers.
defaultValue: false
type: string
required: false
add_host:
- name: add_host
description: Additional `host:ip` mapping.
type: list
required: false

View File

@ -1,4 +1,4 @@
FROM amd64/docker:19.03-dind@sha256:1875a3437d87a2fa8ec5e6fcd3233a98d571fa9692516b1e7d8eb18b7dca87a4
FROM amd64/docker:20.10-dind@sha256:56a2d342dd7f25fd604f71513f765526bd522f3c256bead83b6d30c5a8006fa6
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"

View File

@ -1,23 +0,0 @@
FROM arm32v7/docker:19.03-dind@sha256:f998921d365053bf7e3f98794f6c23ca44e6809832d78105bc4d2da6bb8521ed
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.title="drone-docker"
LABEL org.opencontainers.image.url="https://github.com/thegeeklab/drone-docker"
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/drone-docker"
LABEL org.opencontainers.image.documentation="https://github.com/thegeeklab/drone-docker"
ENV DOCKER_HOST=unix:///var/run/docker.sock
RUN apk --update add --virtual .build-deps curl && \
mkdir -p /etc/docker/ && \
curl -SsL -o /etc/docker/default.json https://raw.githubusercontent.com/moby/moby/19.03/profiles/seccomp/default.json && \
sed -i 's/SCMP_ACT_ERRNO/SCMP_ACT_TRACE/g' /etc/docker/default.json && \
chmod 600 /etc/docker/default.json && \
apk del .build-deps && \
rm -rf /var/cache/apk/* && \
rm -rf /tmp/*
ADD dist/drone-docker /bin/
ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "drone-docker"]

View File

@ -1,4 +1,4 @@
FROM arm64v8/docker:19.03-dind@sha256:81f35202223dcd33991fcb0e12d287f854dfb63b0b47e0c805ed87c0dfc4c9b3
FROM arm64v8/docker:20.10-dind@sha256:26c7da097331ba685a7314fcfc0eb608b86b4074bab5e1beaeb57d744c5c060a
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"

View File

@ -16,9 +16,3 @@ manifests:
architecture: arm64
os: linux
variant: v8
- image: quay.io/thegeeklab/drone-docker:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm
platform:
architecture: arm
os: linux
variant: v7

View File

@ -16,9 +16,3 @@ manifests:
architecture: arm64
os: linux
variant: v8
- image: thegeeklab/drone-docker:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm
platform:
architecture: arm
os: linux
variant: v7

4
go.mod
View File

@ -6,8 +6,8 @@ require (
github.com/coreos/go-semver v0.3.0
github.com/joho/godotenv v1.4.0
github.com/sirupsen/logrus v1.9.0
github.com/thegeeklab/drone-plugin-lib/v2 v2.1.0
github.com/urfave/cli/v2 v2.11.1
github.com/thegeeklab/drone-plugin-lib/v2 v2.2.1
github.com/urfave/cli/v2 v2.23.7
)
require (

8
go.sum
View File

@ -16,10 +16,10 @@ github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/thegeeklab/drone-plugin-lib/v2 v2.1.0 h1:RtEiRTQFCeMEnLQOmbswETWoNHVEvb9W4EnV3ZbuIdg=
github.com/thegeeklab/drone-plugin-lib/v2 v2.1.0/go.mod h1:2sHIUXma4CozXNTgh55MxGcvSK8u0ITlkOKZwDDmVAk=
github.com/urfave/cli/v2 v2.11.1 h1:UKK6SP7fV3eKOefbS87iT9YHefv7iB/53ih6e+GNAsE=
github.com/urfave/cli/v2 v2.11.1/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo=
github.com/thegeeklab/drone-plugin-lib/v2 v2.2.1 h1:fta32M+y6aHG/BX+Kwxo9DQAcYpTyCBHn7sAm2qjfL0=
github.com/thegeeklab/drone-plugin-lib/v2 v2.2.1/go.mod h1:Bu++VS6GXEWCHQdzR65dPsGtBGOMuqAQPiRVBaa+HrY=
github.com/urfave/cli/v2 v2.23.7 h1:YHDQ46s3VghFHFf1DdF+Sh7H4RqhcM+t0TmZRJx4oJY=
github.com/urfave/cli/v2 v2.23.7/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ=