move most of this image over to docker.jcg.re/base-caddy, to make it integratable
All checks were successful
the build was successful
All checks were successful
the build was successful
This commit is contained in:
parent
a441803975
commit
e3b5864f34
1 changed files with 1 additions and 40 deletions
41
Dockerfile
Executable file → Normal file
41
Dockerfile
Executable file → Normal file
|
@ -1,43 +1,4 @@
|
||||||
FROM docker.jcg.re/base-alpine
|
FROM docker.jcg.re/base-caddy
|
||||||
MAINTAINER Jan Christian Grünhage <jan.christian@gruenhage.xyz>
|
|
||||||
|
|
||||||
ARG CLONE_URL=github.com/mholt/caddy
|
|
||||||
ARG BRANCH
|
|
||||||
|
|
||||||
ENV GOPATH=/gopath \
|
|
||||||
UID=192 \
|
|
||||||
GID=192
|
|
||||||
|
|
||||||
ADD plugins.txt /plugins
|
|
||||||
|
|
||||||
RUN apk upgrade --update \
|
|
||||||
&& apk add \
|
|
||||||
build-base \
|
|
||||||
su-exec \
|
|
||||||
libcap \
|
|
||||||
go \
|
|
||||||
git \
|
|
||||||
bash \
|
|
||||||
&& mkdir -p ${GOPATH}/src/${CLONE_URL} \
|
|
||||||
&& cd $GOPATH/src/${CLONE_URL} \
|
|
||||||
&& git clone https://${CLONE_URL} . \
|
|
||||||
&& git checkout ${BRANCH:-$(git describe --abbrev=0 --tags)} \
|
|
||||||
&& 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 ${CLONE_URL}/... \
|
|
||||||
&& mv $GOPATH/bin/caddy /usr/bin \
|
|
||||||
&& setcap cap_net_bind_service=+ep /usr/bin/caddy \
|
|
||||||
&& apk del --purge build-base go \
|
|
||||||
&& mkdir /caddy \
|
|
||||||
&& rm -rf $GOPATH /var/cache/apk/* /plugins
|
|
||||||
|
|
||||||
ADD root /
|
ADD root /
|
||||||
|
|
||||||
EXPOSE 2015 80 443
|
EXPOSE 2015 80 443
|
||||||
VOLUME ["/caddy", "/var/www"]
|
VOLUME ["/caddy", "/var/www"]
|
||||||
|
|
Loading…
Reference in a new issue