Skip to content

Commit 4baf2f0

Browse files
committed
Initial draft of plugin.
1 parent a51b159 commit 4baf2f0

16 files changed

Lines changed: 858 additions & 0 deletions

.github/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Docker Daemon WoodpeckerCI Plugin
2+
3+
[![pulls](https://img.shields.io/docker/pulls/kokuwaio/dockerd)](https://hub.docker.com/r/kokuwaio/dockerd)
4+
[![size](https://img.shields.io/docker/image-size/kokuwaio/dockerd)](https://hub.docker.com/r/kokuwaio/dockerd)
5+
[![dockerfile](https://img.shields.io/badge/source-Dockerfile%20-blue)](https://git.kokuwa.io/woodpecker/dockerd/src/branch/main/Dockerfile)
6+
[![license](https://img.shields.io/badge/License-EUPL%201.2-blue)](https://git.kokuwa.io/woodpecker/dockerd/src/branch/main/LICENSE)
7+
[![prs](https://img.shields.io/gitea/pull-requests/open/woodpecker/dockerd?gitea_url=https%3A%2F%2Fgit.kokuwa.io)](https://git.kokuwa.io/woodpecker/dockerd/pulls)
8+
[![issues](https://img.shields.io/gitea/issues/open/woodpecker/dockerd?gitea_url=https%3A%2F%2Fgit.kokuwa.io)](https://git.kokuwa.io/woodpecker/dockerd/issues)
9+
10+
A [Woodpecker I](https://woodpecker-ci.org) prepared docker daemon.
11+
Also usable with Gitlab, Github or locally, see examples for usage.
12+
13+
For more documention see: [git.kokuwa.io/woodpecker/dockerd](https://git.kokuwa.io/woodpecker/dockerd)

.github/workflows/build.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build
2+
3+
on: push
4+
5+
jobs:
6+
7+
dockerd:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@main
11+
- uses: docker/setup-qemu-action@master
12+
- uses: docker/setup-buildx-action@master
13+
- uses: docker/build-push-action@master
14+
with:
15+
platforms: linux/amd64,linux/arm64
16+
17+
cli:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@main
21+
- uses: docker/setup-qemu-action@master
22+
- uses: docker/setup-buildx-action@master
23+
- uses: docker/build-push-action@master
24+
with:
25+
target: cli-az-git
26+
platforms: linux/amd64,linux/arm64

.github/workflows/lint.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Lint
2+
3+
on: push
4+
5+
jobs:
6+
7+
renovate:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@main
11+
- uses: docker://kokuwaio/renovate-config-validator
12+
13+
markdownlint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@main
17+
- uses: docker://kokuwaio/markdownlint
18+
19+
yamllint:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@main
23+
- uses: docker://kokuwaio/yamllint
24+
25+
hadolint:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@main
29+
- uses: docker://kokuwaio/hadolint
30+
31+
shellcheck:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@main
35+
- uses: docker://kokuwaio/shellcheck

.justfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# https://just.systems/man/en/
2+
3+
[private]
4+
@default:
5+
just --list --unsorted
6+
7+
# Run linter.
8+
@lint:
9+
docker run --rm --read-only --volume=$(pwd):$(pwd):ro --workdir=$(pwd) kokuwaio/shellcheck
10+
docker run --rm --read-only --volume=$(pwd):$(pwd):ro --workdir=$(pwd) kokuwaio/hadolint
11+
docker run --rm --read-only --volume=$(pwd):$(pwd):ro --workdir=$(pwd) kokuwaio/yamllint
12+
docker run --rm --read-only --volume=$(pwd):$(pwd):rw --workdir=$(pwd) kokuwaio/markdownlint --fix
13+
docker run --rm --read-only --volume=$(pwd):$(pwd):ro --workdir=$(pwd) kokuwaio/renovate
14+
docker run --rm --read-only --volume=$(pwd):$(pwd):ro --workdir=$(pwd) woodpeckerci/woodpecker-cli lint
15+
16+
# Build image with local docker daemon.
17+
@build:
18+
docker build . --target=dockerd --tag=kokuwaio/dockerd:dev
19+
docker build . --target=cli --tag=kokuwaio/docker-cli:dev
20+
docker build . --target=cli-git --tag=kokuwaio/docker-cli:dev-git
21+
docker build . --target=cli-az --tag=kokuwaio/docker-cli:dev-az
22+
docker build . --target=cli-az-git --tag=kokuwaio/docker-cli:dev-az-git
23+
24+
# Inspect image with docker.
25+
@inspect IMAGE="dockerd:dev": build
26+
docker image inspect kokuwaio/{{IMAGE}}
27+
28+
# Inspect image layers with `dive`.
29+
@dive IMAGE="dockerd:dev": build
30+
dive kokuwaio/{{IMAGE}}

.markdownlint.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Default state for all rules
2+
default: true
3+
4+
# MD009 - Trailing spaces
5+
MD009:
6+
strict: true
7+
8+
# MD013 - Line length
9+
MD013: false

.woodpecker/build.yaml

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
when:
2+
instance: ci.kokuwa.io
3+
repo: woodpecker/docker
4+
event: [manual, push, pull_request]
5+
branch: main
6+
path: [.woodpecker/build.yaml, Dockerfile, Dockerfile.dockerignore, entrypoint.sh]
7+
8+
variables:
9+
- step: &pr
10+
image: kokuwaio/buildctl
11+
depends_on: []
12+
settings: &settings-pr
13+
platform: [linux/amd64, linux/arm64]
14+
build-args: {PYPI_MIRROR: "${PYPI_MIRROR}"}
15+
auth:
16+
registry.kokuwa.io:
17+
username: {from_secret: kokuwa_io_username}
18+
password: {from_secret: kokuwa_io_password}
19+
annotation: &annotation
20+
org.opencontainers.image.title: Docker CLI for WoodpeckerCI
21+
org.opencontainers.image.description: Docker CLI for usage in WoodpeckerCI.
22+
org.opencontainers.image.url: $CI_REPO_URL
23+
org.opencontainers.image.documentation: $CI_REPO_URL/README.md
24+
org.opencontainers.image.source: $CI_REPO_CLONE_URL
25+
org.opencontainers.image.revision: $CI_COMMIT_SHA
26+
org.opencontainers.image.vendor: kokuwa.io
27+
org.opencontainers.image.licenses: EUPL-1.2
28+
org.opencontainers.image.ref.name: kokuwaio/docker-cli
29+
org.opencontainers.image.version: 28.1.1
30+
when:
31+
event: pull_request
32+
- step: &push
33+
image: kokuwaio/buildctl
34+
depends_on: []
35+
settings: &settings-push
36+
<<: *settings-pr
37+
auth:
38+
"https://index.docker.io/v1/":
39+
username: {from_secret: docker_io_username}
40+
password: {from_secret: docker_io_password}
41+
ghcr.io:
42+
username: {from_secret: ghcr_io_username}
43+
password: {from_secret: ghcr_io_password}
44+
registry.kokuwa.io:
45+
username: {from_secret: kokuwa_io_username}
46+
password: {from_secret: kokuwa_io_password}
47+
when:
48+
event: [manual, push]
49+
branch: main
50+
51+
steps:
52+
53+
dockerd-pr:
54+
<<: *pr
55+
settings:
56+
<<: *settings-pr
57+
name: registry.kokuwa.io/kokuwaio/dockerd:ci-${CI_PIPELINE_NUMBER}
58+
target: dockerd
59+
annotation:
60+
<<: *annotation
61+
org.opencontainers.image.title: Docker Daemon for WoodpeckerCI
62+
org.opencontainers.image.description: Docker daemon for usage in WoodpeckerCI.
63+
org.opencontainers.image.ref.name: kokuwaio/dockerd
64+
65+
cli-pr:
66+
<<: *pr
67+
settings:
68+
<<: *settings-pr
69+
name: registry.kokuwa.io/kokuwaio/docker-cli:ci-${CI_PIPELINE_NUMBER}
70+
target: cli
71+
72+
cli-git-pr:
73+
<<: *pr
74+
depends_on: [cli-pr]
75+
settings:
76+
<<: *settings-pr
77+
name: registry.kokuwa.io/kokuwaio/docker-cli:ci-${CI_PIPELINE_NUMBER}-git
78+
target: cli-git
79+
80+
cli-az-pr:
81+
<<: *pr
82+
depends_on: [cli-pr]
83+
settings:
84+
<<: *settings-pr
85+
name: registry.kokuwa.io/kokuwaio/docker-cli:ci-${CI_PIPELINE_NUMBER}-az
86+
target: cli-az
87+
88+
cli-az-git-pr:
89+
<<: *pr
90+
depends_on: [cli-az-pr]
91+
settings:
92+
<<: *settings-pr
93+
name: registry.kokuwa.io/kokuwaio/docker-cli:ci-${CI_PIPELINE_NUMBER}-az-git
94+
target: cli-az-git
95+
96+
dockerd:
97+
<<: *push
98+
settings:
99+
<<: *settings-push
100+
name:
101+
- registry.kokuwa.io/kokuwaio/dockerd:latest
102+
- registry.kokuwa.io/kokuwaio/dockerd:28.1.1
103+
- docker.io/kokuwaio/dockerd:latest
104+
- docker.io/kokuwaio/dockerd:28.1.1
105+
- ghcr.io/kokuwaio/dockerd:latest
106+
- ghcr.io/kokuwaio/dockerd:28.1.1
107+
target: dockerd
108+
annotation:
109+
<<: *annotation
110+
org.opencontainers.image.title: Docker Daemon for WoodpeckerCI
111+
org.opencontainers.image.description: Docker daemon for usage in WoodpeckerCI.
112+
org.opencontainers.image.ref.name: kokuwaio/dockerd
113+
114+
cli:
115+
<<: *push
116+
depends_on: [cli]
117+
settings:
118+
<<: *settings-push
119+
name:
120+
- registry.kokuwa.io/kokuwaio/docker-cli:latest
121+
- registry.kokuwa.io/kokuwaio/dockerd:28.1.1
122+
- docker.io/kokuwaio/dockerd:latest
123+
- docker.io/kokuwaio/dockerd:28.1.1
124+
- ghcr.io/kokuwaio/dockerd:latest
125+
- ghcr.io/kokuwaio/dockerd:28.1.1
126+
target: cli
127+
128+
cli-git:
129+
<<: *push
130+
settings:
131+
<<: *settings-push
132+
name:
133+
- registry.kokuwa.io/kokuwaio/docker-cli:git
134+
- registry.kokuwa.io/kokuwaio/dockerd:28.1.1-git
135+
- docker.io/kokuwaio/dockerd:git
136+
- docker.io/kokuwaio/dockerd:28.1.1-git
137+
- ghcr.io/kokuwaio/dockerd:git
138+
- ghcr.io/kokuwaio/dockerd:28.1.1-git
139+
target: cli-git
140+
141+
cli-az:
142+
<<: *push
143+
depends_on: [cli]
144+
settings:
145+
<<: *settings-push
146+
name:
147+
- registry.kokuwa.io/kokuwaio/docker-cli:az
148+
- registry.kokuwa.io/kokuwaio/dockerd:28.1.1-az
149+
- docker.io/kokuwaio/dockerd:az
150+
- docker.io/kokuwaio/dockerd:28.1.1-az
151+
- ghcr.io/kokuwaio/dockerd:az
152+
- ghcr.io/kokuwaio/dockerd:28.1.1-az
153+
target: cli-az
154+
155+
cli-az-git:
156+
<<: *push
157+
depends_on: [cli-az]
158+
settings:
159+
<<: *settings-push
160+
name:
161+
- registry.kokuwa.io/kokuwaio/docker-cli:az-git
162+
- registry.kokuwa.io/kokuwaio/dockerd:28.1.1-az-git
163+
- docker.io/kokuwaio/dockerd:az-git
164+
- docker.io/kokuwaio/dockerd:28.1.1-az-git
165+
- ghcr.io/kokuwaio/dockerd:az-git
166+
- ghcr.io/kokuwaio/dockerd:28.1.1-az-git
167+
target: cli-az-git

.woodpecker/dockerhub.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
when:
2+
instance: ci.kokuwa.io
3+
repo: woodpecker/docker
4+
event: [manual, push]
5+
branch: main
6+
path: [.woodpecker/dockerhub.yaml, README.md]
7+
8+
steps:
9+
10+
dockerd:
11+
image: kokuwaio/dockerhub-metadata
12+
depends_on: []
13+
settings:
14+
repository: kokuwaio/dockerd
15+
description-short: Docker daemon for usage in WoodpeckerCI.
16+
categories: [developer-tools, integration-and-delivery]
17+
username: {from_secret: dockerhub_username}
18+
password: {from_secret: dockerhub_password}
19+
20+
docker-cli:
21+
image: kokuwaio/dockerhub-metadata
22+
depends_on: []
23+
settings:
24+
repository: kokuwaio/docker-cli
25+
description-short: Docker CLI for usage in WoodpeckerCI.
26+
categories: [developer-tools, integration-and-delivery]
27+
username: {from_secret: dockerhub_username}
28+
password: {from_secret: dockerhub_password}

.woodpecker/lint.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
when:
2+
event: [manual, push, pull_request]
3+
branch: main
4+
path: [.woodpecker/lint.yaml, renovate.json, "**/*.yaml", "**/*.md", "**/*.sh", "**/Dockerfile"]
5+
6+
steps:
7+
8+
renovate:
9+
image: kokuwaio/renovate-config-validator
10+
depends_on: []
11+
when: [path: [.woodpecker/lint.yaml, renovate.json]]
12+
13+
yaml:
14+
image: kokuwaio/yamllint
15+
depends_on: []
16+
when: [path: [.woodpecker/lint.yaml, .yamllint.yaml, "**/*.yaml"]]
17+
18+
markdown:
19+
image: kokuwaio/markdownlint
20+
depends_on: []
21+
when: [path: [.woodpecker/lint.yaml, .markdownlint.yaml, "**/*.md"]]
22+
23+
dockerfile:
24+
image: kokuwaio/hadolint
25+
depends_on: []
26+
when: [path: [.woodpecker/lint.yaml, "**/Dockerfile"]]
27+
28+
shellcheck:
29+
image: kokuwaio/shellcheck
30+
depends_on: []
31+
when: [path: [.woodpecker/lint.yaml, "**/*.sh"]]

.woodpecker/test.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
when:
2+
instance: ci.kokuwa.io
3+
repo: woodpecker/docker
4+
event: pull_request
5+
path: [.woodpecker/build.yaml, .woodpecker/test.yaml, Dockerfile, Dockerfile.dockerignore, entrypoint.sh]
6+
7+
depends_on: [build]
8+
matrix:
9+
PLATFORM: [amd64, arm64]
10+
labels:
11+
platform: linux/${PLATFORM}
12+
13+
services:
14+
- name: dockerd
15+
image: registry.kokuwa.io/kokuwaio/dockerd:ci-${CI_PIPELINE_NUMBER}
16+
ports: [2375]
17+
privileged: true
18+
19+
steps:
20+
21+
info:
22+
image: registry.kokuwa.io/kokuwaio/docker-cli:ci-${CI_PIPELINE_NUMBER}
23+
commands: docker info
24+
25+
pull:
26+
image: registry.kokuwa.io/kokuwaio/docker-cli:ci-${CI_PIPELINE_NUMBER}
27+
commands: docker pull bash
28+
29+
run:
30+
image: registry.kokuwa.io/kokuwaio/docker-cli:ci-${CI_PIPELINE_NUMBER}
31+
commands: docker run --rm bash uname -a

.yamllint.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
extends: default
2+
3+
## see https://yamllint.readthedocs.io/en/stable/rules.html
4+
rules:
5+
6+
# no need for document start
7+
document-start: disable
8+
9+
# line length is not important
10+
line-length: disable
11+
12+
# force double quotes everywhere
13+
quoted-strings:
14+
quote-type: double
15+
required: only-when-needed
16+
17+
# allow everything on keys
18+
truthy:
19+
check-keys: false

0 commit comments

Comments
 (0)