Switched to my base image, updated to v0.10.3

This commit is contained in:
Jan Christian Grünhage 2017-06-28 14:22:17 +02:00
parent 2edd3f7c6c
commit 4c3bb68055
Signed by untrusted user who does not match committer: jcgruenhage
GPG key ID: 321A67D9EE8BC3E1
3 changed files with 34 additions and 35 deletions

View file

@ -1,41 +1,39 @@
FROM alpine:edge FROM jcgruenhage/baseimage-alpine
MAINTAINER Jan Christian Grünhage <mail@janchristiangruenhage.de> MAINTAINER Jan Christian Grünhage <jan.christian@gruenhage.xyz>
ENV GOPATH /gopath ENV GOPATH=/gopath \
ENV CADDY_REPO_OWNER mholt CADDY_REPO_OWNER=mholt \
ENV CADDY_REPO_NAME caddy CADDY_REPO_NAME=caddy \
ENV CADDY_BRANCH tags/v0.10.2 CADDY_BRANCH=tags/v0.10.3 \
ENV CADDYPATH /caddy CADDYPATH=/caddy \
ENV UID 192 UID=192 \
ENV GID 192 GID=192
COPY plugins.txt /plugins ADD plugins.txt /plugins
RUN apk add --update musl \ RUN apk upgrade --update \
&& apk add --no-cache build-base su-exec libcap tini go git \ && apk add build-base su-exec libcap go git \
&& mkdir -p $GOPATH/src/github.com/$CADDY_REPO_OWNER \ && mkdir -p $GOPATH/src/github.com/$CADDY_REPO_OWNER \
&& cd $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 \ && git clone https://github.com/$CADDY_REPO_OWNER/$CADDY_REPO_NAME \
&& cd $CADDY_REPO_NAME \ && cd $CADDY_REPO_NAME \
&& git checkout $CADDY_BRANCH \ && git checkout $CADDY_BRANCH \
&& cd caddy/caddymain \ && cd caddy/caddymain \
&& export line="$(grep -n "// This is where other plugins get plugged in (imported)" < run.go | sed 's/^\([0-9]\+\):.*$/\1/')" \ && 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 \ && head -n ${line} run.go > newrun.go \
&& cat /plugins >> newrun.go \ && cat /plugins >> newrun.go \
&& line=`expr $line + 1` \ && line=`expr $line + 1` \
&& tail -n +${line} run.go >> newrun.go \ && tail -n +${line} run.go >> newrun.go \
&& rm -f run.go \ && rm -f run.go \
&& mv newrun.go run.go \ && mv newrun.go run.go \
&& go get github.com/$CADDY_REPO_OWNER/$CADDY_REPO_NAME/... \ && go get github.com/$CADDY_REPO_OWNER/$CADDY_REPO_NAME/... \
&& mv $GOPATH/bin/caddy /usr/bin \ && mv $GOPATH/bin/caddy /usr/bin \
&& setcap cap_net_bind_service=+ep /usr/bin/caddy \ && setcap cap_net_bind_service=+ep /usr/bin/caddy \
&& apk del --purge build-base go \ && apk del --purge build-base go \
&& mkdir $CADDYPATH \ && mkdir $CADDYPATH \
&& rm -rf $GOPATH /var/cache/apk/* /plugins && rm -rf $GOPATH /var/cache/apk/* /plugins
COPY root / ADD root /
EXPOSE 2015 80 443 EXPOSE 2015 80 443
VOLUME ["$CADDYPATH" ] VOLUME ["$CADDYPATH"]
WORKDIR "$CADDYPATH"
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/run.sh"]

1
root/etc/s6.d/caddy/finish Executable file
View file

@ -0,0 +1 @@
#!/bin/sh