1
0
Fork 0

Compare commits

...

143 Commits

Author SHA1 Message Date
GitHub Action 14565441a6 Bump Caddy version 2024-05-08 20:22:53 +00:00
GitHub Action f6022c46fb Bump Caddy version 2024-05-08 20:22:52 +00:00
GitHub Action fdfce2a81c Bump Caddy version 2024-05-03 01:41:01 +00:00
GitHub Action 5768a90b31 Bump Caddy version 2024-05-03 01:41:00 +00:00
Ambrose Chua f014d96bc1
Update build.yml 2024-05-03 09:40:30 +08:00
GitHub Action 0ef9134a42 Bump Caddy version 2023-05-18 01:41:20 +00:00
GitHub Action 14d411b907 Bump Caddy version 2023-05-18 01:41:18 +00:00
GitHub Action 5ed6cc159c Bump Caddy version 2023-02-15 20:25:38 +00:00
GitHub Action 8b27a83a84 Bump Caddy version 2023-02-15 20:25:37 +00:00
Ambrose Chua 3ebf3fc291
Update build_weekly.yml 2023-02-09 09:25:35 +08:00
GitHub Action 59c1669554 Bump Caddy version 2023-02-09 01:20:26 +00:00
GitHub Action 16082b038b Bump Caddy version 2023-02-09 01:20:24 +00:00
Ambrose Chua 9b948a4ba2
Update build.yml 2023-02-09 09:19:55 +08:00
Ambrose Chua 7f50e64c1a
Update build.yml 2023-02-09 09:11:40 +08:00
Ambrose Chua c478473e0e Attempt debug 2022-07-09 19:38:07 +08:00
Ambrose Chua 67a4f2d5f8 Update Actions 2022-07-09 19:23:14 +08:00
Ambrose Chua 8f7d5bf6a4 Disable Docker Hub Description update 2021-11-16 15:13:27 +08:00
Ambrose Chua 1397f67595 Update README with shared tags 2021-11-16 15:10:04 +08:00
Ambrose Chua 3c9e831f0d Remove microbadger 2021-11-16 15:00:47 +08:00
GitHub Action 2d52734b3f Bump Caddy version 2021-11-16 06:51:28 +00:00
GitHub Action 2669484688 Bump Caddy version 2021-11-16 06:51:27 +00:00
Ambrose Chua 689ed13540 Fix shared tags 2021-11-16 14:50:16 +08:00
Ambrose Chua 56d0d0dc50 Update README to link to Docker Hub and GitHub 2021-11-16 14:33:44 +08:00
Ambrose Chua 822c883b71 Automatically update README 2021-11-16 14:25:09 +08:00
GitHub Action 557186b6fb Bump Caddy version 2021-11-16 05:52:11 +00:00
GitHub Action 633a5c0eac Bump Caddy version 2021-11-16 05:52:10 +00:00
Ambrose Chua c7c3ddf617
Add workflow_dispatch trigger 2021-11-16 13:51:43 +08:00
GitHub Action f660d42d6e Bump Caddy version 2021-06-24 20:21:45 +00:00
GitHub Action d3130c840d Bump Caddy version 2021-06-24 20:21:42 +00:00
GitHub Action dde82baa17 Bump Caddy version 2021-06-14 20:28:45 +00:00
GitHub Action f622a3a2d9 Bump Caddy version 2021-06-14 20:28:42 +00:00
GitHub Action 09d805fb5f Bump Caddy version 2021-05-24 20:35:49 +00:00
GitHub Action c71bbe4939 Bump Caddy version 2021-05-24 20:35:46 +00:00
Ambrose Chua f7b2050be3
Remove push trigger on weekly 2021-05-12 08:54:14 +08:00
Ambrose Chua d43e9fbcbd
Put shared single arch on weekly 2021-05-12 08:52:45 +08:00
Ambrose Chua e8fbdd9f17
Put shared single arch 2021-05-12 08:52:23 +08:00
Ambrose Chua 7c6a095c41
Create build_weekly.yml 2021-05-12 08:44:17 +08:00
Ambrose Chua 4aac5d2a7a
Disable put-shared 2021-05-12 08:37:22 +08:00
GitHub Action 94591546dd Bump Caddy version 2021-05-11 20:33:14 +00:00
GitHub Action 586185dfce Bump Caddy version 2021-05-11 17:04:07 +00:00
GitHub Action fb83eac642 Bump Caddy version 2021-05-11 15:15:34 +00:00
Ambrose Chua cae374aaf2
Fix conditional in build 2021-05-11 23:14:57 +08:00
GitHub Action 07010b57b7 Bump Caddy version 2021-05-11 15:11:44 +00:00
Ambrose Chua 6a74fac6ff
Always build if either bashbrew or dockerfiles changed 2021-05-11 23:11:12 +08:00
GitHub Action c0db25d860 Bump Caddy version 2021-05-11 01:30:43 +00:00
GitHub Action 9a5873f661 Bump Caddy version 2021-05-11 01:30:40 +00:00
GitHub Action b8d251a249 Bump Caddy version 2021-05-05 20:31:28 +00:00
GitHub Action d54e90a2ac Bump Caddy version 2021-05-05 20:31:25 +00:00
GitHub Action e236366905 Bump Caddy version 2021-04-02 20:32:14 +00:00
GitHub Action aee9a5e6c7 Bump Caddy version 2021-04-02 20:32:09 +00:00
Ambrose Chua 15135ed66f
Update README.md 2021-02-28 23:09:27 +08:00
GitHub Action 5dc844faa7 Bump Caddy version 2021-02-24 20:30:10 +00:00
GitHub Action f62dd31263 Bump Caddy version 2021-02-24 20:30:05 +00:00
GitHub Action 0e93da04f4 Bump Caddy version 2021-01-04 20:42:20 +00:00
GitHub Action cf5d03865d Bump Caddy version 2021-01-04 20:42:15 +00:00
GitHub Action 15e4d4bd52 Bump Caddy version 2020-12-15 01:12:27 +00:00
GitHub Action 4165746846 Bump Caddy version 2020-12-15 01:12:23 +00:00
GitHub Action 8f0cb4e70f Bump Caddy version 2020-10-14 20:27:51 +00:00
GitHub Action 87e7c0a928 Bump Caddy version 2020-10-14 20:27:47 +00:00
GitHub Action 98766a80e5 Bump Caddy version 2020-09-26 06:18:32 +00:00
GitHub Action a3762b1ce5 Bump Caddy version 2020-09-26 06:18:28 +00:00
Ambrose Chua c2ac938342 Reset again 2020-09-26 14:17:35 +08:00
Ambrose Chua 0117c72e5c Reset 2020-09-26 14:12:53 +08:00
Ambrose Chua 4738a14c42
Exclude builder image 2020-09-26 14:11:09 +08:00
GitHub Action aaab8e600b Bump Caddy version 2020-09-26 01:02:54 +00:00
GitHub Action 27a4557052 Bump Caddy version 2020-09-26 01:02:49 +00:00
Ambrose Chua 047842607a
Describe new tags 2020-07-03 01:58:02 +08:00
GitHub Action 023ea621be Bump Caddy version 2020-07-02 17:51:19 +00:00
GitHub Action 43ff38498c Bump Caddy version 2020-07-02 17:51:14 +00:00
Ambrose Chua a9418b602d
Trigger build 2020-07-03 01:50:44 +08:00
GitHub Action bf2e8395bf Bump Caddy version 2020-07-02 17:32:51 +00:00
GitHub Action f572761455 Bump Caddy version 2020-07-02 17:32:46 +00:00
Ambrose Chua 46b2bab9fc
Delete Dockerfile 2020-07-03 01:32:16 +08:00
Ambrose Chua 706879ff2e
Add manifest-tool for shared tags 2020-07-03 01:32:05 +08:00
GitHub Action 9c00d3f361 Bump Caddy version 2020-07-02 17:18:00 +00:00
GitHub Action 8a82abe69d Bump Caddy version 2020-07-02 17:17:55 +00:00
Ambrose Chua 23390cf95b
Trigger rebuild 2020-07-03 01:17:24 +08:00
Ambrose Chua f4dbe327f8
Put shared tags too 2020-07-03 01:17:01 +08:00
Ambrose Chua 43024a740f Improve workflow names 2020-07-03 01:05:56 +08:00
Ambrose Chua 089874ef6c Add library comitter 2020-07-03 01:03:38 +08:00
GitHub Action 2504d7391d Bump Caddy version 2020-07-02 16:58:11 +00:00
Ambrose Chua f65f157230 Fix workflow conditions 2020-07-03 00:57:33 +08:00
GitHub Action 875f158ce2 Bump Caddy version 2020-07-02 16:39:48 +00:00
Ambrose Chua a7558751f2 Cleanup 2020-07-03 00:38:13 +08:00
Ambrose Chua 6269d93c31 Remove path conditions 2020-07-03 00:36:38 +08:00
Ambrose Chua f8ec8e8d78 Add Go to workflow 2020-07-03 00:34:56 +08:00
Ambrose Chua 1f2ed024fd Initial revamp test 2020-07-03 00:31:29 +08:00
Ambrose Chua 679134731b
Erm this might be better 2020-07-02 00:11:00 +08:00
Ambrose Chua d1fa52b7b0
Seems like I have to maintain this manually 2020-07-01 23:59:56 +08:00
serverwentdown 8d9447f765 Bump Caddy version 2020-07-01 00:38:36 +00:00
serverwentdown cc3bde2409 Bump Caddy version 2020-06-29 20:13:10 +00:00
serverwentdown c5550fe7c7 Bump Caddy version 2020-06-27 00:30:35 +00:00
serverwentdown f1ebc94f8d Regenerate stackbrew library
continuous-integration/drone/push Build is failing Details
2020-06-13 16:13:07 +00:00
serverwentdown 0087b38b91 Bump Caddy version 2020-06-13 16:12:52 +00:00
serverwentdown 19c57bc1d2 Regenerate stackbrew library
continuous-integration/drone/push Build is passing Details
2020-05-16 08:13:05 +00:00
serverwentdown 65baab83e7 Bump Caddy version 2020-05-16 08:12:50 +00:00
Ambrose Chua 93d02f84e8
Update image URL
continuous-integration/drone/push Build is passing Details
2020-05-16 13:37:03 +08:00
Ambrose Chua 87fefa0458
Add bicrobadger hook 2020-05-16 13:29:38 +08:00
serverwentdown ecadea0524 Regenerate stackbrew library
continuous-integration/drone/push Build is passing Details
2020-05-13 08:13:07 +00:00
serverwentdown 3066abca96 Bump Caddy version 2020-05-13 08:12:51 +00:00
Ambrose Chua fd25593ddb
Tell Drone which Dockerfile
continuous-integration/drone/push Build was killed Details
2020-05-13 15:47:59 +08:00
Ambrose Chua 0ca103eca0
Fix Drone registry login
continuous-integration/drone/push Build is failing Details
2020-05-13 15:40:28 +08:00
Ambrose Chua fe7c86f473
Update README.md
continuous-integration/drone/push Build is failing Details
2020-05-13 15:27:51 +08:00
Ambrose Chua e6854eeefa
Use Docker official image builds instead of caddy 2020-05-13 15:25:00 +08:00
Ambrose Chua f86a0e9ee6 Add back Drone builds
continuous-integration/drone/push Build is failing Details
2020-05-13 15:05:37 +08:00
serverwentdown 8a0ff810a3 Regenerate stackbrew library 2020-05-13 06:47:45 +00:00
Ambrose Chua 3ccd25c006
Test updated Dockerfile 2020-05-13 14:47:14 +08:00
Ambrose Chua ba22478c6e Use a personal access token to trigger builds 2020-05-13 14:46:22 +08:00
serverwentdown dacf5242f3 Regenerate stackbrew library 2020-05-13 06:29:10 +00:00
Ambrose Chua ab2a827634
Test updating of Dockerfile 2020-05-13 14:28:40 +08:00
Ambrose Chua 0998309920
Fix Action git add 2020-05-13 14:26:35 +08:00
Ambrose Chua e48ada02f8 Update Dockerfile 2020-05-13 14:24:40 +08:00
Ambrose Chua 8847460c5e Initial GitHub Actions pipeline test 2020-05-13 14:21:13 +08:00
Ambrose Chua 6cfd270096
Update drone pipeline
continuous-integration/drone/push Build is passing Details
2020-05-13 13:53:49 +08:00
Ambrose Chua 0397eabadc
Always pull 2020-05-13 13:37:05 +08:00
Ambrose Chua cef2751b69
Update stackbrew library
continuous-integration/drone/push Build is failing Details
2020-05-13 13:35:36 +08:00
Ambrose Chua 326aceeeb7
Update stackbrew library
continuous-integration/drone/push Build is failing Details
2020-05-13 13:34:18 +08:00
Ambrose Chua 3f3df5bfac
Fix legacy image files
continuous-integration/drone/push Build is failing Details
2020-05-13 13:28:26 +08:00
Ambrose Chua 66d4e1fca3
Remove accidental image line
continuous-integration/drone/push Build is failing Details
2020-05-13 12:47:36 +08:00
Ambrose Chua a026db8fcf
Add DIND socket
continuous-integration/drone/push Build is failing Details
2020-05-13 12:46:58 +08:00
Ambrose Chua 60a482c943
Allow privileged use of Docker in the host
continuous-integration/drone/push Build is failing Details
2020-05-13 12:41:45 +08:00
Ambrose Chua 2f71859427
Test pipeline
continuous-integration/drone/push Build is failing Details
2020-05-13 12:35:21 +08:00
Ambrose Chua 1cac395869
Update README
continuous-integration/drone/push Build is failing Details
2020-05-13 12:22:11 +08:00
Ambrose Chua 50220cb01f
Update GitCommit
continuous-integration/drone/push Build is failing Details
2020-05-13 12:17:21 +08:00
Ambrose Chua c50f1ef8cf
Update namespace 2020-05-13 12:16:51 +08:00
Ambrose Chua 8c5b7acbe4
Add more arches 2020-05-13 12:11:20 +08:00
Ambrose Chua 14fbdc939d
Bump Git versions
continuous-integration/drone/push Build is failing Details
2020-05-13 12:08:15 +08:00
Ambrose Chua bbe5659668
Add dockerhub pipeline
continuous-integration/drone/push Build is failing Details
2020-05-13 12:03:50 +08:00
Ambrose Chua 7ea0fc0f01
Improvements to versioning and legacy
continuous-integration/drone/push Build is failing Details
2020-05-13 11:43:58 +08:00
Ambrose Chua 2ac27f11bd
Experimental bashbrew 2020-04-08 01:57:25 +08:00
Ambrose Chua c97b19e1dd
Push warning for Caddy 2
continuous-integration/drone/push Build is passing Details
2020-04-08 00:28:52 +08:00
Ambrose Chua 317ffa9037
Bump Caddy version
continuous-integration/drone/push Build is failing Details
2020-04-07 23:04:28 +08:00
Ambrose Chua e294615557
Merge pull request #7 from nikitabuyevich/patch-1
fix(readme): missing build path
2020-04-07 23:03:28 +08:00
Nikita Buyevich bdfb983d16
fix(readme): missing build path 2020-04-02 21:42:46 -05:00
Ambrose Chua 38c5157832
Bump Go version
continuous-integration/drone/push Build is passing Details
2019-12-19 18:07:38 +08:00
Ambrose Chua 85b1d53505
Update Dockerfile
continuous-integration/drone/push Build is failing Details
2019-12-14 10:44:31 +08:00
Ambrose Chua d943766e16
Merge pull request #6 from chinkung/master
continuous-integration/drone/push Build is passing Details
Bump Caddy to 1.0.3 and improve build process
2019-08-26 07:58:03 +08:00
Chinnawat Wipawapat 9ab3c55344 Bump Caddy to 1.0.3 and improve build process
- Create go.mod dynamically based on version argument in Dockerfile
- Remove intermediate debian build since upx and ca-certificates are available in alpine package
2019-08-26 02:58:46 +07:00
Ambrose Chua 9d2a10af2e
Bump Caddy to 1.0.2
continuous-integration/drone/push Build is passing Details
2019-08-24 18:30:25 +08:00
Andrew Lavrentev fe96ed1959 bump to 1.0.2 2019-08-18 11:32:23 +03:00
Ambrose Chua 581992184b
Bump Caddy to 1.0.1
continuous-integration/drone/push Build encountered an error Details
2019-08-03 00:54:20 +08:00
Ambrose Chua e8e5f6b618 Update issue templates
continuous-integration/drone/push Build was killed Details
2019-07-12 23:10:23 +08:00
Ambrose Chua 92fff2b6df
Update size of image
continuous-integration/drone/push Build is passing Details
Sadly, Caddy has grown.
2019-07-02 14:01:17 +08:00
20 changed files with 674 additions and 196 deletions

View File

@ -1,15 +0,0 @@
kind: pipeline
name: default
steps:
- name: docker
image: plugins/docker
settings:
registry: registry.makerforce.io
repo: registry.makerforce.io/pwd/caddy
tags:
- latest
username:
from_secret: docker_username
password:
from_secret: docker_password

20
.github/ISSUE_TEMPLATE/bug.md vendored Normal file
View File

@ -0,0 +1,20 @@
---
name: Bug
about: Report a bug
title: ''
labels: bug
assignees: ''
---
### Describe the problem
(Give a concise description of the problem)
### Steps to reproduce
1. (Detail every step)
### Screenshots or logs
(Attach logs as GitHub Gists)

86
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,86 @@
name: Update, build and push Docker images
on:
schedule:
- cron: "12 */4 * * *"
push:
branches:
- master
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
container:
image: hairyhenderson/dockerfiles-builder:latest
env:
BASHBREW_LIBRARY: ./library
BASHBREW_NAMESPACE: productionwentdown
BASHBREW_ARCH_NAMESPACES: amd64=productionwentdown
if: github.repository == 'productionwentdown/caddy' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- name: Set Git user
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
git config --global --add safe.directory $(pwd)
- name: Install Go
run: |
apk add --no-cache go
- name: Regenerate Dockerfiles
run: |
go run update.go -dockerfiles -readme
- name: Commit and push changes
id: commit-dockerfiles
run: |
git add */*/Dockerfile README.md
if output=$(git status --porcelain) && [ ! -z "$output" ]; then
git commit -m "Bump Caddy version" -a
git push
echo "::set-output name=bumped::yes"
fi
- name: Regenerate Bashbrew manifests
if: steps.commit-dockerfiles.outputs.bumped == 'yes'
run: |
go run update.go -manifest -commit $(git log -1 --format='format:%H' HEAD)
- name: Commit and push changes
if: steps.commit-dockerfiles.outputs.bumped == 'yes'
id: commit-bashbrew
run: |
git add library/caddy
if output=$(git status --porcelain) && [ ! -z "$output" ]; then
git commit -m "Bump Caddy version" -a
git push
echo "::set-output name=bumped::yes"
fi
- name: Build images on Linux
if: steps.commit-dockerfiles.outputs.bumped == 'yes' || steps.commit-bashbrew.outputs.bumped == 'yes'
run: |
bashbrew build --pull always caddy
- name: Push images
if: steps.commit-dockerfiles.outputs.bumped == 'yes' || steps.commit-bashbrew.outputs.bumped == 'yes'
run: |
wget https://github.com/estesp/manifest-tool/releases/download/v2.1.6/binaries-manifest-tool-2.1.6.tar.gz -O manifest-tool.tar.gz
tar -xf manifest-tool.tar.gz
mv manifest-tool-linux-amd64 /usr/local/bin/manifest-tool
chmod +x /usr/local/bin/manifest-tool
echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
bashbrew push caddy
bashbrew put-shared --single-arch caddy
#- name: Update Docker Hub Description
# uses: peter-evans/dockerhub-description@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# repository: productionwentdown/caddy

32
.github/workflows/build_weekly.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Build and push Docker images weekly
on:
schedule:
- cron: "12 16 * * 2"
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
container:
image: hairyhenderson/dockerfiles-builder:latest
env:
BASHBREW_LIBRARY: ./library
BASHBREW_NAMESPACE: productionwentdown
BASHBREW_ARCH_NAMESPACES: amd64=productionwentdown
if: github.repository == 'productionwentdown/caddy' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- name: Build images on Linux
run: |
bashbrew build --pull always caddy
- name: Push images
run: |
wget https://github.com/estesp/manifest-tool/releases/download/v1.0.2/manifest-tool-linux-amd64 -O /usr/local/bin/manifest-tool
chmod +x /usr/local/bin/manifest-tool
echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
bashbrew push caddy
bashbrew put-shared --single-arch caddy

1
.gitignore vendored
View File

@ -1,2 +1 @@
caddy.go
go.sum

37
2.1/alpine/Dockerfile Normal file
View File

@ -0,0 +1,37 @@
FROM caddy:2.1.1-alpine as build
RUN apk add --no-cache upx ca-certificates \
&& upx --ultra-brute /usr/bin/caddy \
&& caddy version
FROM scratch
COPY --from=build /etc/caddy/Caddyfile /etc/caddy/Caddyfile
COPY --from=build /usr/share/caddy/index.html /usr/share/caddy/index.html
COPY --from=build /usr/bin/caddy /usr/bin/caddy
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /etc/nsswitch.conf /etc/nsswitch.conf
ENV XDG_CONFIG_HOME=/config
ENV XDG_DATA_HOME=/data
ENV HOME=/
VOLUME /config
VOLUME /data
LABEL org.opencontainers.image.version=v2.1.1
LABEL org.opencontainers.image.title="Caddy (productionwentdown build)"
LABEL org.opencontainers.image.description="a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go"
LABEL org.opencontainers.image.url=https://productionwentdown.makerforce.io
LABEL org.opencontainers.image.documentation=https://caddyserver.com/docs
LABEL org.opencontainers.image.vendor="productionwentdown"
LABEL org.opencontainers.image.licenses=Apache-2.0
LABEL org.opencontainers.image.source="https://github.com/productionwentdown/caddy"
EXPOSE 80
EXPOSE 443
EXPOSE 2019
WORKDIR /srv
CMD ["/usr/bin/caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]

37
2.2/alpine/Dockerfile Normal file
View File

@ -0,0 +1,37 @@
FROM caddy:2.2.1-alpine as build
RUN apk add --no-cache upx ca-certificates \
&& upx --ultra-brute /usr/bin/caddy \
&& caddy version
FROM scratch
COPY --from=build /etc/caddy/Caddyfile /etc/caddy/Caddyfile
COPY --from=build /usr/share/caddy/index.html /usr/share/caddy/index.html
COPY --from=build /usr/bin/caddy /usr/bin/caddy
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /etc/nsswitch.conf /etc/nsswitch.conf
ENV XDG_CONFIG_HOME=/config
ENV XDG_DATA_HOME=/data
ENV HOME=/
VOLUME /config
VOLUME /data
LABEL org.opencontainers.image.version=v2.2.1
LABEL org.opencontainers.image.title="Caddy (productionwentdown build)"
LABEL org.opencontainers.image.description="a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go"
LABEL org.opencontainers.image.url=https://productionwentdown.makerforce.io
LABEL org.opencontainers.image.documentation=https://caddyserver.com/docs
LABEL org.opencontainers.image.vendor="productionwentdown"
LABEL org.opencontainers.image.licenses=Apache-2.0
LABEL org.opencontainers.image.source="https://github.com/productionwentdown/caddy"
EXPOSE 80
EXPOSE 443
EXPOSE 2019
WORKDIR /srv
CMD ["/usr/bin/caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]

37
2.3/alpine/Dockerfile Normal file
View File

@ -0,0 +1,37 @@
FROM caddy:2.3.0-alpine as build
RUN apk add --no-cache upx ca-certificates \
&& upx --ultra-brute /usr/bin/caddy \
&& caddy version
FROM scratch
COPY --from=build /etc/caddy/Caddyfile /etc/caddy/Caddyfile
COPY --from=build /usr/share/caddy/index.html /usr/share/caddy/index.html
COPY --from=build /usr/bin/caddy /usr/bin/caddy
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /etc/nsswitch.conf /etc/nsswitch.conf
ENV XDG_CONFIG_HOME=/config
ENV XDG_DATA_HOME=/data
ENV HOME=/
VOLUME /config
VOLUME /data
LABEL org.opencontainers.image.version=v2.3.0
LABEL org.opencontainers.image.title="Caddy (productionwentdown build)"
LABEL org.opencontainers.image.description="a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go"
LABEL org.opencontainers.image.url=https://productionwentdown.makerforce.io
LABEL org.opencontainers.image.documentation=https://caddyserver.com/docs
LABEL org.opencontainers.image.vendor="productionwentdown"
LABEL org.opencontainers.image.licenses=Apache-2.0
LABEL org.opencontainers.image.source="https://github.com/productionwentdown/caddy"
EXPOSE 80
EXPOSE 443
EXPOSE 2019
WORKDIR /srv
CMD ["/usr/bin/caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]

37
2.4/alpine/Dockerfile Normal file
View File

@ -0,0 +1,37 @@
FROM caddy:2.4.6-alpine as build
RUN apk add --no-cache upx ca-certificates \
&& upx --ultra-brute /usr/bin/caddy \
&& caddy version
FROM scratch
COPY --from=build /etc/caddy/Caddyfile /etc/caddy/Caddyfile
COPY --from=build /usr/share/caddy/index.html /usr/share/caddy/index.html
COPY --from=build /usr/bin/caddy /usr/bin/caddy
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /etc/nsswitch.conf /etc/nsswitch.conf
ENV XDG_CONFIG_HOME=/config
ENV XDG_DATA_HOME=/data
ENV HOME=/
VOLUME /config
VOLUME /data
LABEL org.opencontainers.image.version=v2.4.6
LABEL org.opencontainers.image.title="Caddy (productionwentdown build)"
LABEL org.opencontainers.image.description="a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go"
LABEL org.opencontainers.image.url=https://productionwentdown.makerforce.io
LABEL org.opencontainers.image.documentation=https://caddyserver.com/docs
LABEL org.opencontainers.image.vendor="productionwentdown"
LABEL org.opencontainers.image.licenses=Apache-2.0
LABEL org.opencontainers.image.source="https://github.com/productionwentdown/caddy"
EXPOSE 80
EXPOSE 443
EXPOSE 2019
WORKDIR /srv
CMD ["/usr/bin/caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]

37
2.6/alpine/Dockerfile Normal file
View File

@ -0,0 +1,37 @@
FROM caddy:2.6.4-alpine as build
RUN apk add --no-cache upx ca-certificates \
&& upx --ultra-brute /usr/bin/caddy \
&& caddy version
FROM scratch
COPY --from=build /etc/caddy/Caddyfile /etc/caddy/Caddyfile
COPY --from=build /usr/share/caddy/index.html /usr/share/caddy/index.html
COPY --from=build /usr/bin/caddy /usr/bin/caddy
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /etc/nsswitch.conf /etc/nsswitch.conf
ENV XDG_CONFIG_HOME=/config
ENV XDG_DATA_HOME=/data
ENV HOME=/
VOLUME /config
VOLUME /data
LABEL org.opencontainers.image.version=v2.6.4
LABEL org.opencontainers.image.title="Caddy (productionwentdown build)"
LABEL org.opencontainers.image.description="a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go"
LABEL org.opencontainers.image.url=https://productionwentdown.makerforce.io
LABEL org.opencontainers.image.documentation=https://caddyserver.com/docs
LABEL org.opencontainers.image.vendor="productionwentdown"
LABEL org.opencontainers.image.licenses=Apache-2.0
LABEL org.opencontainers.image.source="https://github.com/productionwentdown/caddy"
EXPOSE 80
EXPOSE 443
EXPOSE 2019
WORKDIR /srv
CMD ["/usr/bin/caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]

37
2.7/alpine/Dockerfile Normal file
View File

@ -0,0 +1,37 @@
FROM caddy:2.7.6-alpine as build
RUN apk add --no-cache upx ca-certificates \
&& upx --ultra-brute /usr/bin/caddy \
&& caddy version
FROM scratch
COPY --from=build /etc/caddy/Caddyfile /etc/caddy/Caddyfile
COPY --from=build /usr/share/caddy/index.html /usr/share/caddy/index.html
COPY --from=build /usr/bin/caddy /usr/bin/caddy
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /etc/nsswitch.conf /etc/nsswitch.conf
ENV XDG_CONFIG_HOME=/config
ENV XDG_DATA_HOME=/data
ENV HOME=/
VOLUME /config
VOLUME /data
LABEL org.opencontainers.image.version=v2.7.6
LABEL org.opencontainers.image.title="Caddy (productionwentdown build)"
LABEL org.opencontainers.image.description="a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go"
LABEL org.opencontainers.image.url=https://productionwentdown.makerforce.io
LABEL org.opencontainers.image.documentation=https://caddyserver.com/docs
LABEL org.opencontainers.image.vendor="productionwentdown"
LABEL org.opencontainers.image.licenses=Apache-2.0
LABEL org.opencontainers.image.source="https://github.com/productionwentdown/caddy"
EXPOSE 80
EXPOSE 443
EXPOSE 2019
WORKDIR /srv
CMD ["/usr/bin/caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]

37
2.8/alpine/Dockerfile Normal file
View File

@ -0,0 +1,37 @@
FROM caddy:2.8.0-beta.2-alpine as build
RUN apk add --no-cache upx ca-certificates \
&& upx --ultra-brute /usr/bin/caddy \
&& caddy version
FROM scratch
COPY --from=build /etc/caddy/Caddyfile /etc/caddy/Caddyfile
COPY --from=build /usr/share/caddy/index.html /usr/share/caddy/index.html
COPY --from=build /usr/bin/caddy /usr/bin/caddy
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /etc/nsswitch.conf /etc/nsswitch.conf
ENV XDG_CONFIG_HOME=/config
ENV XDG_DATA_HOME=/data
ENV HOME=/
VOLUME /config
VOLUME /data
LABEL org.opencontainers.image.version=v2.8.0
LABEL org.opencontainers.image.title="Caddy (productionwentdown build)"
LABEL org.opencontainers.image.description="a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go"
LABEL org.opencontainers.image.url=https://productionwentdown.makerforce.io
LABEL org.opencontainers.image.documentation=https://caddyserver.com/docs
LABEL org.opencontainers.image.vendor="productionwentdown"
LABEL org.opencontainers.image.licenses=Apache-2.0
LABEL org.opencontainers.image.source="https://github.com/productionwentdown/caddy"
EXPOSE 80
EXPOSE 443
EXPOSE 2019
WORKDIR /srv
CMD ["/usr/bin/caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]

View File

@ -1,3 +0,0 @@
:2015 {
root /srv
}

View File

@ -1,82 +0,0 @@
#
# Build stage
#
FROM golang:1.12-alpine as build
# args
ARG version="1.0.0"
# add plugin import paths here separated by commas
ARG plugins=""
ARG telemetry="true"
# deps
RUN apk add --no-cache git
# build root
RUN mkdir /build
WORKDIR /build
ENV GO111MODULE=on
ENV CGO_ENABLED=0
# plugins
COPY go.mod plugger.go ./
RUN go run plugger.go -plugins="${plugins}" -telemetry="${telemetry}"
# build
RUN go build
RUN mv caddy /
#
# Compress Caddy with upx
#
FROM debian:stable as compress
ARG upx_version="3.94"
# dependencies
RUN apt-get update && apt install -y --no-install-recommends \
tar \
xz-utils \
curl \
ca-certificates
# get official upx binary
RUN curl --silent --show-error --fail --location -o - \
"https://github.com/upx/upx/releases/download/v${upx_version}/upx-${upx_version}-amd64_linux.tar.xz" \
| tar --no-same-owner -C /usr/bin/ -xJ \
--strip-components 1 upx-${upx_version}-amd64_linux/upx
# copy and compress
COPY --from=build /caddy /usr/bin/caddy
RUN /usr/bin/upx --ultra-brute /usr/bin/caddy
# test
RUN /usr/bin/caddy -version
#
# Final image
#
FROM scratch
# labels
LABEL org.label-schema.vcs-url="https://github.com/productionwentdown/caddy"
LABEL org.label-schema.version=${version}
LABEL org.label-schema.schema-version="1.0"
# copy binary and ca certs
COPY --from=compress /usr/bin/caddy /bin/caddy
COPY --from=compress /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
# copy default caddyfile
COPY Caddyfile /etc/Caddyfile
# set default caddypath
ENV CADDYPATH=/etc/.caddy
VOLUME /etc/.caddy
# serve from /srv
WORKDIR /srv
ENTRYPOINT ["/bin/caddy", "--conf", "/etc/Caddyfile", "--log", "stdout"]

View File

@ -1,38 +1,25 @@
# [caddy](https://hub.docker.com/r/productionwentdown/caddy/) [![](https://images.microbadger.com/badges/version/productionwentdown/caddy.svg)](https://microbadger.com/images/productionwentdown/caddy "Get your own version badge on microbadger.com") [![](https://images.microbadger.com/badges/image/productionwentdown/caddy.svg)](https://microbadger.com/images/productionwentdown/caddy "Get your own image badge on microbadger.com")
# [caddy](https://hub.docker.com/r/productionwentdown/caddy) ![Docker Pulls](https://img.shields.io/docker/pulls/productionwentdown/caddy?style=flat-square) ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/productionwentdown/caddy/alpine?style=flat-square)
A tiny 4MB Caddy image compressed with [UPX](https://github.com/upx/upx).
A tiny <10MB Caddy image compressed with [UPX](https://github.com/upx/upx).
> Notice: I keep this manually updated. If it goes out of date, ping me via Twitter [@serverwentdown](https://twitter.com/serverwentdown).
- [Docker Hub](https://hub.docker.com/r/productionwentdown/caddy)
- [GitHub](https://github.com/productionwentdown/caddy)
## Simple Tags
New versions are tracked within 4 hours. Currently available versions:
* `2.8.0-beta.2-alpine`, `2.8-alpine`
* `2.7.6-alpine`, `2.7-alpine`, `2-alpine`, `alpine`
## Shared Tags
* `2.8.0-beta.2`, `2.8`
* `2.8.0-beta.2-alpine`
* `2.7.6`, `2.7`, `2`, `latest`
* `2.7.6-alpine`
# Usage
Serve files in `$PWD`:
```
docker run -it --rm -p 2015:2015 -v $PWD:/srv productionwentdown/caddy
```
Overwrite `Caddyfile`:
```
docker run -it --rm -p 2015:2015 -v $PWD:/srv -v $PWD/Caddyfile:/etc/Caddyfile productionwentdown/caddy
```
Persist `.caddy` to avoid hitting Let's Encrypt's rate limit:
```
docker run -it --rm -p 2015:2015 -v $PWD:/srv -v $PWD/Caddyfile:/etc/Caddyfile -v $HOME/.caddy:/etc/.caddy productionwentdown/caddy
```
# Build with plugins
Using `docker build` arguments:
```
docker build -t caddy --build-arg plugins=github.com/abiosoft/caddy-git,github.com/zikes/gopkg .
```
You can also fork and edit plugger.go for more advanced plugin configuration
# Build without telemetry
```
docker build -t caddy --build-arg telemetry=false
```
See the [official image](https://hub.docker.com/_/caddy) for documentation. This image behaves the same way, except that it is slightly slimmer.

9
go.mod
View File

@ -1,3 +1,8 @@
module caddy
module github.com/productionwentdown/caddy
require github.com/mholt/caddy v1.0.0
go 1.16
require (
github.com/docker-library/go-dockerlibrary v0.0.0-20200821205225-669fbe5c1d52
pault.ag/go/debian v0.12.0 // indirect
)

16
go.sum Normal file
View File

@ -0,0 +1,16 @@
github.com/DataDog/zstd v1.4.8/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
github.com/docker-library/go-dockerlibrary v0.0.0-20200821205225-669fbe5c1d52 h1:Z3GnSICOyARBY/IBnOWtNN8N4AVRRDWxPEH28AM8wsg=
github.com/docker-library/go-dockerlibrary v0.0.0-20200821205225-669fbe5c1d52/go.mod h1:ijRhN3WM71dD8TfohKoUdX46BT2uz/Ek5O+5PINI880=
github.com/kjk/lzma v0.0.0-20161016003348-3fd93898850d/go.mod h1:phT/jsRPBAEqjAibu1BurrabCBNTYiVI+zbmyCZJY6Q=
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E=
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
pault.ag/go/debian v0.12.0 h1:b8ctSdBSGJ98NE1VLn06aSx70EUpczlP2qqSHEiYYJA=
pault.ag/go/debian v0.12.0/go.mod h1:UbnMr3z/KZepjq7VzbYgBEfz8j4+Pyrm2L5X1fzhy/k=
pault.ag/go/topsort v0.0.0-20160530003732-f98d2ad46e1a h1:WwS7vlB5H2AtwKj1jsGwp2ZLud1x6WXRXh2fXsRqrcA=
pault.ag/go/topsort v0.0.0-20160530003732-f98d2ad46e1a/go.mod h1:INqx0ClF7kmPAMk2zVTX8DRnhZ/yaA/Mg52g8KFKE7k=

15
library/caddy Normal file
View File

@ -0,0 +1,15 @@
Maintainers: Ambrose Chua <ambrose@makerforce.io> (@serverwentdown)
Tags: 2.8.0-beta.2-alpine, 2.8-alpine
SharedTags: 2.8.0-beta.2, 2.8
Architectures: amd64, arm32v6, arm32v7, arm64v8, ppc64le, s390x
GitRepo: https://github.com/productionwentdown/caddy.git
GitCommit: f6022c46fb03bdcd9b31e24b94eee9db96e8ba52
Directory: 2.8/alpine
Tags: 2.7.6-alpine, 2.7-alpine, 2-alpine, alpine
SharedTags: 2.7.6, 2.7, 2, latest
Architectures: amd64, arm32v6, arm32v7, arm64v8, ppc64le, s390x
GitRepo: https://github.com/productionwentdown/caddy.git
GitCommit: f6022c46fb03bdcd9b31e24b94eee9db96e8ba52
Directory: 2.7/alpine

View File

@ -1,61 +0,0 @@
// +build ignore
package main
import (
"flag"
"log"
"os"
"strings"
"text/template"
)
var plugins string
var telemetry bool
func main() {
flag.StringVar(&plugins, "plugins", "", "Specify plugins by full paths, seperated by commas")
flag.BoolVar(&telemetry, "telemetry", false, "Enable telemetry")
flag.Parse()
d := &data{
Plugins: strings.FieldsFunc(plugins, func(c rune) bool { return c == ',' }),
EnableTelemetry: telemetry,
}
log.Printf("Additional plugins: %v", d.Plugins)
log.Printf("Enabled telemetry: %v", d.EnableTelemetry)
f, err := os.Create("caddy.go")
defer f.Close()
if err != nil {
log.Fatal("Unable to open file")
}
t := template.Must(template.New("caddy.go").Parse(caddyTemplate))
t.Execute(f, d)
}
type data struct {
Plugins []string
EnableTelemetry bool
}
var caddyTemplate = `
package main
import (
"github.com/mholt/caddy/caddy/caddymain"
// plug in plugins here
{{range $plugin := .Plugins}}
_ "{{$plugin}}"
{{end}}
)
func main() {
// optional: disable telemetry
caddymain.EnableTelemetry = {{.EnableTelemetry}}
caddymain.Run()
}
`

220
update.go Normal file
View File

@ -0,0 +1,220 @@
package main
import (
"flag"
"io/ioutil"
"os"
"path"
"strings"
"text/template"
"github.com/docker-library/go-dockerlibrary/manifest"
)
var manifestURL = "https://github.com/docker-library/official-images/raw/master/library/caddy"
var maintainers = []string{"Ambrose Chua <ambrose@makerforce.io> (@serverwentdown)"}
var gitRepo = "https://github.com/productionwentdown/caddy.git"
var readmeTemplate = template.Must(template.New("readme").Parse(`
# [caddy](https://hub.docker.com/r/productionwentdown/caddy) ![Docker Pulls](https://img.shields.io/docker/pulls/productionwentdown/caddy?style=flat-square) ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/productionwentdown/caddy/alpine?style=flat-square)
A tiny &lt;10MB Caddy image compressed with [UPX](https://github.com/upx/upx).
- [Docker Hub](https://hub.docker.com/r/productionwentdown/caddy)
- [GitHub](https://github.com/productionwentdown/caddy)
## Simple Tags
New versions are tracked within 4 hours. Currently available versions:
{{range $entry := .Entries}}* {{range $index, $tag := $entry.Tags}}{{if $index}}, {{end}}` + "`{{$tag}}`" + `{{end}}
{{end}}
## Shared Tags
{{range $entry := .Entries}}* {{range $index, $tag := $entry.SharedTags}}{{if $index}}, {{end}}` + "`{{$tag}}`" + `{{end}}
* ` + "`{{index $entry.Tags 0}}`" + `
{{end}}
# Usage
See the [official image](https://hub.docker.com/_/caddy) for documentation. This image behaves the same way, except that it is slightly slimmer.
`))
var dockerfileTemplate = template.Must(template.New("name").Parse(`FROM caddy:{{.Tag}} as build
RUN apk add --no-cache upx ca-certificates \
&& upx --ultra-brute /usr/bin/caddy \
&& caddy version
FROM scratch
COPY --from=build /etc/caddy/Caddyfile /etc/caddy/Caddyfile
COPY --from=build /usr/share/caddy/index.html /usr/share/caddy/index.html
COPY --from=build /usr/bin/caddy /usr/bin/caddy
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /etc/nsswitch.conf /etc/nsswitch.conf
ENV XDG_CONFIG_HOME=/config
ENV XDG_DATA_HOME=/data
ENV HOME=/
VOLUME /config
VOLUME /data
LABEL org.opencontainers.image.version=v{{.Version}}
LABEL org.opencontainers.image.title="Caddy (productionwentdown build)"
LABEL org.opencontainers.image.description="a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go"
LABEL org.opencontainers.image.url=https://productionwentdown.makerforce.io
LABEL org.opencontainers.image.documentation=https://caddyserver.com/docs
LABEL org.opencontainers.image.vendor="productionwentdown"
LABEL org.opencontainers.image.licenses=Apache-2.0
LABEL org.opencontainers.image.source="https://github.com/productionwentdown/caddy"
EXPOSE 80
EXPOSE 443
EXPOSE 2019
WORKDIR /srv
CMD ["/usr/bin/caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
`))
type dockerfileData struct {
Tag string
Version string
Arch string
}
func main() {
doDockerfiles := flag.Bool("dockerfiles", false, "Update Dockerfiles")
doManifest := flag.Bool("manifest", false, "Update manifest")
doReadme := flag.Bool("readme", false, "Update README.md")
commit := flag.String("commit", "", "Current commit hash")
flag.Parse()
_, _, man, err := manifest.Fetch("nonexistent", manifestURL)
if err != nil {
panic(err)
}
man = subsetManifest(man)
if *doDockerfiles {
err = updateDockerfiles(man)
if err != nil {
panic(err)
}
}
if *doManifest {
err = updateManifest(man, *commit)
if err != nil {
panic(err)
}
}
if *doReadme {
err = updateReadme(man)
if err != nil {
panic(err)
}
}
}
// subsetManifest returns the subset of the manifest that can be built
func subsetManifest(man *manifest.Manifest2822) *manifest.Manifest2822 {
entries := make([]manifest.Manifest2822Entry, 0, 1)
for _, entry := range man.Entries {
isWindows := false
for _, arch := range entry.Architectures {
if strings.Contains(arch, "windows") {
isWindows = true
}
}
isBuilder := false
for _, tag := range entry.Tags {
if strings.Contains(tag, "builder") {
isBuilder = true
}
}
if isWindows || isBuilder {
continue
}
entries = append(entries, entry)
}
return &manifest.Manifest2822{
Global: man.Global,
Entries: entries,
}
}
// updateDockerfiles generates a new set of Dockerfiles based on the manifest
func updateDockerfiles(man *manifest.Manifest2822) error {
for _, entry := range man.Entries {
tag := entry.Tags[0]
version := strings.Split(entry.Tags[0], "-")[0]
for _, arch := range entry.Architectures {
data := dockerfileData{Tag: tag, Version: version, Arch: arch}
err := writeDockerfile(entry, data)
if err != nil {
return err
}
}
}
// TODO: Remove old Dockerfiles
return nil
}
func writeDockerfile(entry manifest.Manifest2822Entry, data dockerfileData) error {
dockerfilePath := path.Join(entry.ArchDirectory(data.Arch), entry.ArchFile(data.Arch))
err := os.MkdirAll(entry.ArchDirectory(data.Arch), 0755)
if err != nil {
return err
}
dockerfileFile, err := os.OpenFile(dockerfilePath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
if err != nil {
return err
}
defer dockerfileFile.Close()
err = dockerfileTemplate.Execute(dockerfileFile, data)
if err != nil {
return err
}
return nil
}
// updateManifest replaces upstream maintainer and Git info with this repo
func updateManifest(man *manifest.Manifest2822, gitCommit string) error {
man.Global.Maintainers = maintainers
for i := range man.Entries {
entry := &man.Entries[i]
entry.Maintainers = maintainers
entry.GitRepo = gitRepo
entry.GitCommit = gitCommit
}
manifestPath := path.Join("library", "caddy")
err := os.MkdirAll("library", 0755)
if err != nil {
return err
}
return ioutil.WriteFile(manifestPath, []byte(man.String()), 0644)
}
// updateReadme generates a new README.md
func updateReadme(man *manifest.Manifest2822) error {
readmeFile, err := os.OpenFile("README.md", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
if err != nil {
return err
}
defer readmeFile.Close()
err = readmeTemplate.Execute(readmeFile, man)
if err != nil {
return err
}
return nil
}