Skip to content

Commit 6344540

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

16 files changed

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