From 4c3bb680556995ea9ecb515e6892aefa8568cfb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= Date: Wed, 28 Jun 2017 14:22:17 +0200 Subject: [PATCH] Switched to my base image, updated to v0.10.3 --- Dockerfile | 68 +++++++++---------- root/etc/s6.d/caddy/finish | 1 + .../local/bin/run.sh => etc/s6.d/caddy/run} | 0 3 files changed, 34 insertions(+), 35 deletions(-) create mode 100755 root/etc/s6.d/caddy/finish rename root/{usr/local/bin/run.sh => etc/s6.d/caddy/run} (100%) diff --git a/Dockerfile b/Dockerfile index bbe5ed0..bd546e4 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,41 +1,39 @@ -FROM alpine:edge -MAINTAINER Jan Christian Grünhage +FROM jcgruenhage/baseimage-alpine +MAINTAINER Jan Christian Grünhage -ENV GOPATH /gopath -ENV CADDY_REPO_OWNER mholt -ENV CADDY_REPO_NAME caddy -ENV CADDY_BRANCH tags/v0.10.2 -ENV CADDYPATH /caddy -ENV UID 192 -ENV GID 192 +ENV GOPATH=/gopath \ + CADDY_REPO_OWNER=mholt \ + CADDY_REPO_NAME=caddy \ + CADDY_BRANCH=tags/v0.10.3 \ + CADDYPATH=/caddy \ + UID=192 \ + GID=192 -COPY plugins.txt /plugins +ADD plugins.txt /plugins -RUN apk add --update musl \ - && apk add --no-cache build-base su-exec libcap tini go git \ - && mkdir -p $GOPATH/src/github.com/$CADDY_REPO_OWNER \ - && cd $GOPATH/src/github.com/$CADDY_REPO_OWNER \ - && git clone https://github.com/$CADDY_REPO_OWNER/$CADDY_REPO_NAME \ - && cd $CADDY_REPO_NAME \ - && git checkout $CADDY_BRANCH \ - && cd caddy/caddymain \ - && export line="$(grep -n "// This is where other plugins get plugged in (imported)" < run.go | sed 's/^\([0-9]\+\):.*$/\1/')" \ - && head -n ${line} run.go > newrun.go \ - && cat /plugins >> newrun.go \ - && line=`expr $line + 1` \ - && tail -n +${line} run.go >> newrun.go \ - && rm -f run.go \ - && mv newrun.go run.go \ - && go get github.com/$CADDY_REPO_OWNER/$CADDY_REPO_NAME/... \ - && mv $GOPATH/bin/caddy /usr/bin \ - && setcap cap_net_bind_service=+ep /usr/bin/caddy \ - && apk del --purge build-base go \ - && mkdir $CADDYPATH \ - && rm -rf $GOPATH /var/cache/apk/* /plugins +RUN apk upgrade --update \ + && apk add build-base su-exec libcap go git \ + && mkdir -p $GOPATH/src/github.com/$CADDY_REPO_OWNER \ + && cd $GOPATH/src/github.com/$CADDY_REPO_OWNER \ + && git clone https://github.com/$CADDY_REPO_OWNER/$CADDY_REPO_NAME \ + && cd $CADDY_REPO_NAME \ + && git checkout $CADDY_BRANCH \ + && cd caddy/caddymain \ + && export line="$(grep -n "// This is where other plugins get plugged in (imported)" < run.go | sed 's/^\([0-9]\+\):.*$/\1/')" \ + && head -n ${line} run.go > newrun.go \ + && cat /plugins >> newrun.go \ + && line=`expr $line + 1` \ + && tail -n +${line} run.go >> newrun.go \ + && rm -f run.go \ + && mv newrun.go run.go \ + && go get github.com/$CADDY_REPO_OWNER/$CADDY_REPO_NAME/... \ + && mv $GOPATH/bin/caddy /usr/bin \ + && setcap cap_net_bind_service=+ep /usr/bin/caddy \ + && apk del --purge build-base go \ + && mkdir $CADDYPATH \ + && rm -rf $GOPATH /var/cache/apk/* /plugins -COPY root / +ADD root / EXPOSE 2015 80 443 -VOLUME ["$CADDYPATH" ] -WORKDIR "$CADDYPATH" -ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/run.sh"] +VOLUME ["$CADDYPATH"] diff --git a/root/etc/s6.d/caddy/finish b/root/etc/s6.d/caddy/finish new file mode 100755 index 0000000..1a24852 --- /dev/null +++ b/root/etc/s6.d/caddy/finish @@ -0,0 +1 @@ +#!/bin/sh diff --git a/root/usr/local/bin/run.sh b/root/etc/s6.d/caddy/run similarity index 100% rename from root/usr/local/bin/run.sh rename to root/etc/s6.d/caddy/run