initial impl
the build was successful Details

This commit is contained in:
Jan Christian Grünhage 2018-03-29 12:32:02 +02:00
parent d5f5e77bbd
commit ada3d11ac4
5 changed files with 64 additions and 2 deletions

7
.drone.yml Normal file
View File

@ -0,0 +1,7 @@
pipeline:
docker:
image: plugins/docker
repo: docker.jcg.re/restic-server
registry: docker.jcg.re
secrets: [docker_username, docker_password]
tags: latest

23
Dockerfile Normal file
View File

@ -0,0 +1,23 @@
FROM docker.jcg.re/base-alpine
RUN apk add --no-cache \
bash \
git \
go \
make \
thttpd \
musl-dev \
&& cd /tmp \
&& git clone https://github.com/restic/rest-server restic \
&& cd restic \
&& make \
&& install -m 755 rest-server /usr/local/bin/rest-server\
&& cd / \
&& rm -rf /tmp/* \
&& apk del \
git \
go \
make
ADD root /
VOLUME /backup

View File

@ -1,3 +1,3 @@
# docker-restic-server
## docker.jcg.re/restic-server
REST Server for Restic Dockerized
REST server for restic, dockerized.

0
root/etc/s6.d/restic/finish Executable file
View File

32
root/etc/s6.d/restic/run Executable file
View File

@ -0,0 +1,32 @@
#!/usr/bin/env bash
if [[ -z ${BACKUP_PATH} ]]; then
BACKUP_PATH="/backup"
fi
COMMAND="rest-server --path ${BACKUP_PATH}"
if [[ -n ${APPEND_ONLY} ]]; then
COMMAND="${COMMAND} --append-only"
fi
if [[ -n ${NO_AUTH} ]]; then
COMMAND="${COMMAND} --no-auth"
fi
if [[ -n ${PROMETHEUS} ]]; then
COMMAND="${COMMAND} --prometheus"
fi
if [[ -n ${PRIVATE_REPOS} ]]; then
COMMAND="${COMMAND} --private-repos"
fi
if [[ -n ${PORT} ]]; then
COMMAND="${COMMAND} --port ${PORT}"
fi
if [[ -n ${DEBUG} ]]; then
COMMAND="${COMMAND} --debug"
fi
if [[ -n ${CPU_PROFILE} ]]; then
COMMAND="${COMMAND} --cpu-profile"
fi
if [[ ! -f ${BACKUP_PATH}/.htpasswd ]]; then
touch ${BACKUP_PATH}/.htpasswd
fi
chown -R ${UID}:${GID} ${BACKUP_PATH}
exec su-exec ${UID}:${GID} ${COMMAND}