Compare commits

..

1 Commits

Author SHA1 Message Date
Christian Richter
feb9039582 attempt 2
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
Signed-off-by: Christian Richter <crichter@owncloud.com>
2022-05-11 16:38:25 +02:00
16 changed files with 208 additions and 299 deletions

View File

@@ -1,199 +1,28 @@
def main(ctx):
return [
stepPR("amd64", "motsognir"),
stepPR("arm64", "motsognir"),
stepMergeMaster("amd64", "motsognir"),
stepMergeMaster("arm64", "motsognir"),
stepBuildWeekly("amd64", "motsognir"),
stepBuildWeekly("arm64", "motsognir"),
stepPR("amd64", "webtest"),
stepPR("arm64", "webtest"),
stepMergeMaster("amd64", "webtest"),
stepMergeMaster("arm64", "webtest"),
stepBuildWeekly("amd64", "webtest"),
stepBuildWeekly("arm64", "webtest"),
return [
step("amd64"),
step("arm64"),
]
stepPR("amd64", "unbound"),
stepPR("arm64", "unbound"),
stepMergeMaster("amd64", "unbound"),
stepMergeMaster("arm64", "unbound"),
stepBuildWeekly("amd64", "unbound"),
stepBuildWeekly("arm64", "unbound"),
notify(ctx),
]
def notify(ctx):
def step(arch):
return {
"kind": "pipeline",
"type": "docker",
"name": "matrix-notifications",
"clone": {
"disable": True,
},
"steps": [
{
"name": "notify",
"image": "plugins/matrix",
"settings": {
"homeserver": {
"from_secret": "matrix-homeserver"
},
"roomid": {
"from_secret": "matrix-room"
},
"username": {
"from_secret": "matrix-user"
},
"password": {
"from_secret": "matrix-password"
}
}
},
],
"depends_on": [
"docker-build-motsognir-amd64",
"docker-build-motsognir-arm64",
"docker-build-webtest-amd64",
"docker-build-webtest-arm64",
"docker-build-unbound-amd64",
"docker-build-unbound-arm64",
"docker-publish-motsognir-amd64",
"docker-publish-motsognir-arm64",
"docker-publish-webtest-amd64",
"docker-publish-webtest-arm64",
"docker-publish-unbound-amd64",
"docker-publish-unbound-arm64",
"docker-publish-weekly-motsognir-amd64",
"docker-publish-weekly-motsognir-arm64",
"docker-publish-weekly-webtest-amd64",
"docker-publish-weekly-webtest-arm64",
"docker-publish-weekly-unbound-amd64",
"docker-publish-weekly-unbound-arm64",
],
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/release*",
"refs/tags/**",
"refs/pull/**",
],
"status": [
"failure",
"success",
],
},
}
def stepPR(arch, path):
return {
"kind": "pipeline",
"type": "docker",
"name": "docker-build-%s-%s" % (path, arch),
"platform": {
"kind": "pipeline",
"type": "docker",
"name": "docker-%s" % (arch),
"platform": {
"os": "linux",
"arch": arch,
},
"steps": [
{
"name": "build-image-%s-%s" % (path, arch),
"image": "plugins/docker",
"settings": {
"dockerfile": "%s/Dockerfile" % (path),
"repo": "dragonchaser/%s" % (path),
"dry_run": "true",
"tag": "latest-%s" % (arch),
}
},
],
"trigger": {
"ref": [
"refs/pull/**",
],
"status": [
"success",
"failure"
]
},
}
def stepMergeMaster(arch, path):
return {
"kind": "pipeline",
"type": "docker",
"name": "docker-publish-%s-%s" % (path, arch),
"platform": {
"os": "linux",
"arch": arch,
},
"steps": [
{
"name": "build-and-publish-image-%s-%s" % (path, arch),
"image": "plugins/docker",
"settings": {
"dockerfile": "%s/Dockerfile" % (path),
"repo": "dragonchaser/%s" % (path),
"dry_run": "false",
"tag": "latest-%s" % (arch),
"username": {
"from_secret": "dockerhub-user"
},
"password": {
"from_secret": "dockerhub-password"
}
}
},
],
"trigger": {
"ref": [
"refs/heads/master",
],
"status": [
"success",
"failure"
]
}
"steps": [
{
"name": "dryrun",
"image": "plugins/docker",
# "image": "thegeeklab/drone-docker:19",
"settings": {
"dockerfile": "motsognir/Dockerfile",
"dry_run": "true",
"repo": "dragonchaser/dockerhub-autobuild",
}
},
],
}
def stepBuildWeekly(arch, path):
return {
"kind": "pipeline",
"type": "docker",
"name": "docker-publish-weekly-%s-%s" % (path, arch),
"platform": {
"os": "linux",
"arch": arch,
},
"steps": [
{
"name": "build-and-publish-image-%s-%s" % (path, arch),
"image": "plugins/docker",
"settings": {
"dockerfile": "%s/Dockerfile" % (path),
"repo": "dragonchaser/%s" % (path),
"dry_run": "false",
"tag": "latest-%s" % (arch),
"username": {
"from_secret": "dockerhub-user"
},
"password": {
"from_secret": "dockerhub-password"
}
}
},
],
"trigger": {
"ref": [
"refs/heads/master",
],
"event": [
"cron"
],
"cron": [
"weekly"
]
},
}

43
.github/workflows/docker-image.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: Docker Image CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
env:
DOCKER_REGISTRY: ghcr.io
DOCKER_IMAGE: dragonchaser/motsognir
DOCKER_TARGET_PLATFORM: "linux/arm/v7,linux/arm64,linux/amd64"
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Prepare
if: success()
id: prepare
run: |
echo ::set-output name=docker_platform::${DOCKER_TARGET_PLATFORM}
echo ::set-output name=docker_image::${DOCKER_REGISTRY}/${DOCKER_IMAGE}
#echo ::set-output name=version::${GITHUB_RUN_NUMBER}
echo ::set-output name=version::latest
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Run Buildx
if: success()
run: |
cd motsognir
docker buildx build --platform ${{ steps.prepare.outputs.docker_platform }} --tag ${{ steps.prepare.outputs.docker_image }}:${{steps.prepare.outputs.version }} --file ./Dockerfile.arm32v7 --output type=image,push=true .

42
.github/workflows/ghrunner.yml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: Docker Image CI for GHRUNNER
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
env:
DOCKER_REGISTRY: ghcr.io
DOCKER_IMAGE: dragonchaser/ghrunner
DOCKER_TARGET_PLATFORM: "linux/arm64,linux/amd64"
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Prepare
if: success()
id: prepare
run: |
echo ::set-output name=docker_platform::${DOCKER_TARGET_PLATFORM}
echo ::set-output name=docker_image::${DOCKER_REGISTRY}/${DOCKER_IMAGE}
echo ::set-output name=version::latest
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Run Buildx
if: success()
run: |
cd ghrunner
docker buildx build --platform ${{ steps.prepare.outputs.docker_platform }} --tag ${{ steps.prepare.outputs.docker_image }}:${{steps.prepare.outputs.version }} --file ./Dockerfile --output type=image,push=true .

1
.gitignore vendored
View File

@@ -1 +0,0 @@
.drone.yml

View File

@@ -1,12 +1,10 @@
# dockerhub-autobuild
[![Build Status](https://drone.services.datenschmutz.space/api/badges/dragonchaser/dockerhub-autobuild/status.svg)](https://drone.services.datenschmutz.space/dragonchaser/dockerhub-autobuild)
This repo contains Dockerfiles used for autobuilding on Dockerhub.
No guarantee for completeness or functionality.
| URL | Folder | Description | x86_64 | aarch64 |
| :-- | :----- | :---------- | :----: | :-----: |
| [dragonchaser/webtest](https://hub.docker.com/r/dragonchaser/webtest) | webtest | A small container running ruby WebRick and serves static content from /web | x | x |
| [dragonchaser/motsognir](https://hub.docker.com/r/dragonchaser/motsognir) | motsognir | A container for the motsognir gopher server | x | x |
| [dragonchaser/unbound](https://hub.docker.com/r/dragonchaser/unbound) | motsognir | A container for unbound dns | x | x |
|URL|Folder|Description|x86_64|arm32v7|aarch64|
|:--|:-----|:----------|:----:|:-----:|:-----:|
|[dragonchaser/webtest](https://hub.docker.com/r/dragonchaser/webtest)|webtest|A small container running ruby WebRick and serves static content from /web|x|x||
|[dragonchaser/motsognir](https://hub.docker.com/r/dragonchaser/motsognir) |motsognir|A container for the motsognir gopher server|x|x||
|[ghcr.io/dragonchaser/ghrunner](https://github.com/dragonchaser/dockerhub-autobuild/pkgs/container/ghrunner)|ghrunner |A container for running github runners |x| |x|

16
ghrunner/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM ubuntu:latest
COPY entrypoint.sh /
ENV TZ=Europe/Berlin
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get -y install \
curl \
libdigest-sha-perl \
tzdata \
sudo
RUN useradd -ms /bin/bash runner
RUN usermod -aG sudo runner
WORKDIR /runner
RUN chown runner:runner /runner -Rfv
ENTRYPOINT ["/entrypoint.sh"]

21
ghrunner/README.md Normal file
View File

@@ -0,0 +1,21 @@
# GHRUNNER
This is a small Dockerfile providing a github runner.
The images can be found `ghcr.io/dragonchaser/ghrunner:latest`.
Supported arches are:
- aarch64
- amd64
## Environment variables
```terminal
| Variable | Values | default |
|------------+----------------------------------------+----------------|
| `TOKEN` | token for runner from github | <unset> |
| `ARCH` | arm64, x64 | x64 |
| `OS` | linux,osx | linux |
| `ORG` | name of the github org | <unset> |
| `REPO` | name of the github repo | <unset> |
| `VERSION` | version of the github runner to user | 2.280.3 |
| `CHECKSUM` | checksum for the github runner version | valid checksum |
```

30
ghrunner/entrypoint.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
ARCH=${ARCH:-x64}
VERSION=${VERSION:-2.280.3}
CHECKSUM=${CHECKSUM:-69dc323312e3c5547ba1e1cc46c127e2ca8ee7d7037e17ee6965ef6dac3c142b}
ORG=${ORG:-dragonchaser}
REPO=${REPO:-dockerhub-autobuild}
OS=${OS:-linux}
if [ -z "${ORG}" ]; then
echo "missing ORG, bailing out!"
fi
if [ -z "${REPO}" ]; then
echo "missing REPO, bailing out!"
fi
if [ -z "${TOKEN}" ]; then
echo "missing TOKEN, bailing out!"
exit 1
fi
FILE="actions-runner-${OS}-${ARCH}-${VERSION}.tar.gz"
curl -o ${FILE} -L https://github.com/actions/runner/releases/download/v${VERSION}/${FILE}
echo "${CHECKSUM} ${FILE}" | shasum -a 256 -c
tar xzf ./${FILE}
./bin/installdependencies.sh
su runner -c "./config.sh --unattended --url https://github.com/${ORG}/${REPO} --token ${TOKEN} --name docker-runner-$(hostname) --labels=${ARCH},${OS},self-hosted"
while true; do
su runner -c "./run.sh"
done

View File

@@ -1,5 +1,5 @@
FROM debian:latest
LABEL maintainer="dragonchaser <autobuilds@datenschmutz.space>"
LABEL maintainer="dragonchaser <crichter@suse.de>"
ENV VERSION=1.0.13
ENV TARBALL="motsognir-${VERSION}.tar.xz"
EXPOSE 70
@@ -9,11 +9,11 @@ WORKDIR /build
RUN wget "https://downloads.sourceforge.net/project/motsognir/v${VERSION}/${TARBALL}" \
&& tar xfv "${TARBALL}"
RUN cd $(echo "${TARBALL}" | sed -e "s/.tar.xz//g") && make all && make install
RUN apt-get -y purge build-essential
RUN apt-get -y purge wget build-essential
RUN rm -Rfv /etc/apt/sources.list.*
RUN rm -Rfv /build
RUN useradd -ms /bin/bash -d /gopher gopher
WORKDIR /gopher
COPY motsognir/entrypoint.sh /
COPY motsognir/rsyslog.conf /etc
COPY entrypoint.sh /
COPY rsyslog.conf /etc
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -0,0 +1,19 @@
FROM arm32v7/debian:buster-slim
#COPY qemu-arm-static /usr/bin
ENV VERSION=1.0.13
ENV TARBALL="motsognir-${VERSION}.tar.xz"
EXPOSE 70
RUN apt-get update \
&& apt-get -y install wget build-essential rsyslog
WORKDIR /build
RUN wget "https://downloads.sourceforge.net/project/motsognir/v${VERSION}/${TARBALL}" \
&& tar xfv "${TARBALL}"
RUN cd $(echo "${TARBALL}" | sed -e "s/.tar.xz//g") && make all && make install
RUN apt-get -y purge wget build-essential
RUN rm -Rfv /etc/apt/sources.list.*
RUN rm -Rfv /build
RUN useradd -ms /bin/bash -d /gopher gopher
WORKDIR /gopher
COPY entrypoint.sh /
COPY rsyslog.conf /etc
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -4,16 +4,16 @@ A container for the motsognir gopher server http://motsognir.sourceforge.net/
## Running locally
**amd64**
**x86_64**
```
$> docker run -p 70:70 -v /path/to/you/local/gopherfolder:/gopher dragonchaser/motsognir:latest-amd64
$> docker run -p 70:70 -v /path/to/you/local/gopherfolder:/gopher dragonchaser/motsognir:latest
```
**arm64**
**arm32v7**
```
$> docker run -p 70:70 -v /path/to/you/local/gopherfolder:/gopher dragonchaser/motsognir:latest-arm64
$> docker run -p 70:70 -v /path/to/you/local/gopherfolder:/gopher dragonchaser/motsognir:latest-arm32v7
```
**Notes:**

View File

@@ -1,8 +0,0 @@
FROM debian:latest
LABEL maintainer="dragonchaser <autobuilds@datenschmutz.space>"
EXPOSE 5335/udp
RUN apt-get update \
&& apt-get -y install unbound netcat-traditional
COPY unbound/config.conf /etc/unbound/unbound.conf.d/
COPY unbound/entrypoint.sh /
ENTRYPOINT /entrypoint.sh

View File

@@ -1,29 +0,0 @@
# unbound
A container for unbound https://github.com/NLnetLabs/unbound
## Running locally
**amd64**
```
$> docker run \
-p 53:53 \
-v /path/to/you/local/unboundfolder/conf:/etc/unbound \
-v /path/to/you/local/unboundfolder/lib:/var/lib/unbound \
dragonchaser/unbound:latest-amd64
```
**arm64**
```
$> docker run \
-p 53:53 \
-v /path/to/you/local/unboundfolder/conf:/etc/unbound \
-v /path/to/you/local/unboundfolder/lib:/var/lib/unbound \
dragonchaser/unbound:latest-arm64
``**
***Note:***
The container will expose the dns port on 5335.

View File

@@ -1,48 +0,0 @@
server:
access-control: 0.0.0.0/0 allow
interface: 0.0.0.0
port: 5335
do-ip6: no
do-ip4: yes
do-udp: yes
do-tcp: yes
# Set number of threads to use
num-threads: 8
# Hide DNS Server info
hide-identity: yes
hide-version: yes
# Limit DNS Fraud and use DNSSEC
harden-glue: yes
harden-dnssec-stripped: yes
harden-referral-path: yes
use-caps-for-id: yes
harden-algo-downgrade: yes
qname-minimisation: yes
aggressive-nsec: yes
rrset-roundrobin: yes
# Minimum lifetime of cache entries in seconds
cache-min-ttl: 300
# Configure TTL of Cache
cache-max-ttl: 14400
# Optimizations
msg-cache-slabs: 8
rrset-cache-slabs: 8
infra-cache-slabs: 8
key-cache-slabs: 8
serve-expired: yes
serve-expired-ttl: 3600
edns-buffer-size: 1232
prefetch: yes
prefetch-key: yes
unwanted-reply-threshold: 10000000
# Set cache size
rrset-cache-size: 256m
msg-cache-size: 128m
# increase buffer size so that no messages are lost in traffic spikes
#so-rcvbuf: 1m
private-address: 192.168.0.0/16
private-address: 169.254.0.0/16
private-address: 172.16.0.0/12
private-address: 10.0.0.0/8
private-address: fd00::/8
private-address: fe80::/10

View File

@@ -1,3 +0,0 @@
#!/bin/bash
unbound-checkconf
unbound -d

View File

@@ -1,12 +1,12 @@
FROM debian:latest
LABEL maintainer="dragonchaser <autobuilds@datenschmutz.space>"
LABEL maintainer="dragonchaser <crichter@suse.de>"
RUN apt-get update \
&& apt-get install -y ruby \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /web \
&& chmod 0777 /web
COPY ./webtest/entrypoint.sh /bin
COPY ./webtest/index.html /web
COPY ./entrypoint.sh /bin
COPY ./index.html /web
WORKDIR /web
EXPOSE 80
ENTRYPOINT entrypoint.sh