From f2323ec81222f59b94188310c4af3363b770bde7 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Wed, 9 Aug 2023 12:46:05 +0200 Subject: [PATCH] initial commit --- .drone.yml | 176 +++++++++++++++++++++++++++++++++++++++++++ .gitignore | 1 + .markdownlint.yml | 6 ++ .prettierignore | 3 + Dockerfile.multiarch | 40 ++++++++++ LICENSE | 21 ++++++ README.md | 15 ++++ overlay/.keep | 0 renovate.json | 4 + 9 files changed, 266 insertions(+) create mode 100644 .drone.yml create mode 100644 .gitignore create mode 100644 .markdownlint.yml create mode 100644 .prettierignore create mode 100644 Dockerfile.multiarch create mode 100644 LICENSE create mode 100644 README.md create mode 100644 overlay/.keep create mode 100644 renovate.json diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..4d41344 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,176 @@ +--- +kind: pipeline +name: test + +platform: + os: linux + arch: amd64 + +steps: + - name: markdownlint + image: thegeeklab/markdownlint-cli + commands: + - markdownlint 'README.md' + +trigger: + ref: + - refs/heads/main + - refs/tags/** + - refs/pull/** + +--- +kind: pipeline +name: build-container + +platform: + os: linux + arch: amd64 + +steps: + - name: tags + image: thegeeklab/docker-autotag + environment: + DOCKER_AUTOTAG_FORCE_LATEST: True + DOCKER_AUTOTAG_IGNORE_PRERELEASE: True + DOCKER_AUTOTAG_OUTPUT_FILE: .tags + DOCKER_AUTOTAG_VERSION: ${DRONE_TAG} + + - name: dryrun + image: thegeeklab/drone-docker-buildx:23 + settings: + dockerfile: Dockerfile.multiarch + dry_run: true + platforms: + - linux/amd64 + - linux/arm64 + - linux/arm/v7 + - linux/arm/v6 + provenance: false + repo: thegeeklab/${DRONE_REPO_NAME} + when: + ref: + - refs/pull/** + depends_on: + - tags + + - name: publish-dockerhub + image: thegeeklab/drone-docker-buildx:23 + settings: + dockerfile: Dockerfile.multiarch + password: + from_secret: docker_password + platforms: + - linux/amd64 + - linux/arm64 + - linux/arm/v7 + - linux/arm/v6 + provenance: false + 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-buildx:23 + settings: + dockerfile: Dockerfile.multiarch + password: + from_secret: quay_password + platforms: + - linux/amd64 + - linux/arm64 + - linux/arm/v7 + - linux/arm/v6 + provenance: false + 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: notifications + +platform: + os: linux + arch: amd64 + +steps: + - name: pushrm-dockerhub + image: chko/docker-pushrm:1 + environment: + DOCKER_PASS: + from_secret: docker_password + DOCKER_USER: + from_secret: docker_username + PUSHRM_FILE: README.md + PUSHRM_SHORT: Custom image for Caddy web server + PUSHRM_TARGET: thegeeklab/${DRONE_REPO_NAME} + when: + status: + - success + + - name: pushrm-quay + image: chko/docker-pushrm:1 + environment: + APIKEY__QUAY_IO: + from_secret: quay_token + PUSHRM_FILE: README.md + PUSHRM_TARGET: quay.io/thegeeklab/${DRONE_REPO_NAME} + when: + status: + - success + + - name: matrix + image: thegeeklab/drone-matrix + settings: + homeserver: + from_secret: matrix_homeserver + password: + from_secret: matrix_password + roomid: + from_secret: matrix_roomid + template: "Status: **{{ .Build.Status }}**
Build: [{{ .Repo.Owner }}/{{ .Repo.Name }}]({{ .Build.Link }}){{ if .Build.Branch }} ({{ .Build.Branch }}){{ end }} by {{ .Commit.Author }}
Message: {{ .Commit.Message.Title }}" + username: + from_secret: matrix_username + when: + status: + - success + - failure + +trigger: + ref: + - refs/heads/main + - refs/tags/** + status: + - success + - failure + +depends_on: + - build-container + +--- +kind: signature +hmac: 18afe60306e170d26a168c7ad7521e4c999b341c847e2fab9bafa38fb1ea8611 + +... diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1b763b1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +CHANGELOG.md 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/.prettierignore b/.prettierignore new file mode 100644 index 0000000..23a4f05 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +.drone.yml +*.tpl.md +LICENSE diff --git a/Dockerfile.multiarch b/Dockerfile.multiarch new file mode 100644 index 0000000..e1b58dc --- /dev/null +++ b/Dockerfile.multiarch @@ -0,0 +1,40 @@ +FROM caddy:2.6.4-alpine + +LABEL maintainer="Robert Kaussow " +LABEL org.opencontainers.image.authors="Robert Kaussow " +LABEL org.opencontainers.image.title="Caddy" +LABEL org.opencontainers.image.url="https://gitea.rknet.org/docker/caddy" +LABEL org.opencontainers.image.source="https://gitea.rknet.org/docker/caddy" +LABEL org.opencontainers.image.documentation="https://gitea.rknet.org/docker/caddy" + +ARG TARGETOS +ARG TARGETARCH +ARG TARGETVARIANT + +ARG GOMPLATE_VERSION + +# renovate: datasource=github-releases depName=hairyhenderson/gomplate +ENV GOMPLATE_VERSION="${GOMPLATE_VERSION:-v3.11.5}" + +RUN addgroup -g 101 -S caddy && \ + adduser -S -D -H -u 101 -h /var/www -s /sbin/nologin -G caddy -g caddy caddy && \ + apk --update add --virtual .build-deps curl && \ + curl -SsfL -o /usr/local/bin/gomplate "https://github.com/hairyhenderson/gomplate/releases/download/${GOMPLATE_VERSION}/gomplate_${TARGETOS}-${TARGETARCH}${TARGETVARIANT}" && \ + chmod 755 /usr/local/bin/gomplate && \ + chown -R caddy:caddy /config /data /etc/caddy /srv && \ + chmod -R 750 /config /data /etc/caddy /srv && \ + apk del .build-deps && \ + rm -rf /var/cache/apk/* && \ + rm -rf /tmp/* + +ADD overlay/ / + +EXPOSE 80 +EXPOSE 443 +EXPOSE 443/udp +EXPOSE 2019 + +USER caddy + +WORKDIR /srv +CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"] diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3812eb4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Robert Kaussow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..0313791 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# caddy + +Custom image for Caddy web server + +[![Build Status](https://img.shields.io/drone/build/docker/caddy?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/docker/caddy) +[![Docker Hub](https://img.shields.io/badge/dockerhub-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/caddy) +[![Quay.io](https://img.shields.io/badge/quay-latest-blue.svg?logo=docker&logoColor=white)](https://quay.io/repository/thegeeklab/caddy) +[![Source: Gitea](https://img.shields.io/badge/source-gitea-blue.svg?logo=gitea&logoColor=white)](https://gitea.rknet.org/docker/caddy) +[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitea.rknet.org/docker/caddy/src/branch/main/LICENSE) + +Custom rootless Docker base image for Caddy based on Alpine. The pre-configured non-root user is a system user named `caddy` with the UID `1001`. There is also a primary group with the same values. + +## License + +This project is licensed under the MIT License - see the [LICENSE](https://gitea.rknet.org/docker/caddy/src/branch/main/LICENSE) file for details. diff --git a/overlay/.keep b/overlay/.keep new file mode 100644 index 0000000..e69de29 diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..5f02575 --- /dev/null +++ b/renovate.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["github>thegeeklab/renovate-presets:docker"] +}