move most of docker.jcg.re/caddy to this new image, docker.jcg.re/base-caddy
All checks were successful
the build was successful
All checks were successful
the build was successful
This commit is contained in:
parent
7d01a794cf
commit
ffb4d69eea
3 changed files with 38 additions and 0 deletions
7
.drone.yml
Normal file
7
.drone.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
pipeline:
|
||||
docker:
|
||||
image: plugins/docker
|
||||
repo: docker.jcg.re/base-caddy
|
||||
registry: docker.jcg.re
|
||||
secrets: [ docker_username, docker_password ]
|
||||
tags: latest
|
31
Dockerfile
Executable file
31
Dockerfile
Executable file
|
@ -0,0 +1,31 @@
|
|||
FROM docker.jcg.re/base-alpine
|
||||
|
||||
|
||||
ENV GOPATH=/gopath
|
||||
|
||||
ONBUILD ADD plugins.txt /plugins
|
||||
ONBUILD ARG BRANCH
|
||||
ONBUILD ARG CLONE_URL=github.com/mholt/caddy
|
||||
ONBUILD RUN apk upgrade --update \
|
||||
&& apk add --no-cache -t build-deps \
|
||||
build-base \
|
||||
libcap \
|
||||
go \
|
||||
git \
|
||||
&& 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-deps \
|
||||
&& rm -rf $GOPATH /plugins
|
0
plugins.txt
Normal file
0
plugins.txt
Normal file
Loading…
Reference in a new issue