diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-03-28 13:09:34 +0000 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-03-28 17:43:33 +0000 |
commit | c3835fc65ec5d5916c97cead5f68de0b50af7b69 (patch) | |
tree | f1b706e9ca84c0dcb6380ba264599f9bdf617631 | |
parent | d8f08600565d5d1359649d81dba4e0014d227577 (diff) |
Add git-daemon docker container
Change-Id: I1d3632c43a9ec551164401beecbaf94a49e2a470
-rw-r--r-- | git-daemon/Dockerfile | 17 | ||||
-rw-r--r-- | git-daemon/LICENSE | 21 | ||||
-rw-r--r-- | git-daemon/Makefile | 1 | ||||
-rwxr-xr-x | git-daemon/git-daemon.sh | 36 |
4 files changed, 75 insertions, 0 deletions
diff --git a/git-daemon/Dockerfile b/git-daemon/Dockerfile new file mode 100644 index 0000000..7dc7d39 --- /dev/null +++ b/git-daemon/Dockerfile @@ -0,0 +1,17 @@ +FROM debian:latest +MAINTAINER laforge@gnumonks.org + +ENV DEBIAN_FRONTEND noninteractive + +# Install git +RUN apt-get update -qq + +RUN apt-get install -qqy git + +ADD git-daemon.sh /usr/bin/git-daemon.sh +VOLUME /git + +# git daemon ports +EXPOSE 9418 + +CMD /usr/bin/git-daemon.sh diff --git a/git-daemon/LICENSE b/git-daemon/LICENSE new file mode 100644 index 0000000..383bdd7 --- /dev/null +++ b/git-daemon/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Cédric Vanet + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/git-daemon/Makefile b/git-daemon/Makefile new file mode 100644 index 0000000..8d0e10b --- /dev/null +++ b/git-daemon/Makefile @@ -0,0 +1 @@ +include ../make/Makefile diff --git a/git-daemon/git-daemon.sh b/git-daemon/git-daemon.sh new file mode 100755 index 0000000..715203d --- /dev/null +++ b/git-daemon/git-daemon.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +#* STRICT_PATHS : 0 or 1, default 0 +#* INIT_TIMEOUT : numeric, 0 - use git default value +#* TIMEOUT : numeric, 0 - use git default value +#* MAX_CONNECTIONS : numeric, default 32 +#* VERBOSE : 0 or 1, default 0 +#* REUSEADDR : 0 or 1, default 1 + +ARGS="" + +if [[ "${STRICT_PATHS}" == "1" ]]; then + ARGS="${ARGS} --strict-paths" +fi + +if [ -z "${REUSEADDR}" ] || [ "${REUSEADDR}" == "1" ]; then + ARGS="${ARGS} --reuseaddr" +fi + +if [ -z "${VERBOSE}" ] || [ "${VERBOSE}" == "1" ]; then + ARGS="${ARGS} --verbose" +fi + +if [ -n "${INIT_TIMEOUT}" ]; then + ARGS="${ARGS} --init-timeout=${TIMEOUT}" +fi + +if [ -n "${TIMEOUT}" ]; then + ARGS="${ARGS} --timeout=${TIMEOUT}" +fi + +if [ -n "${MAX_CONNECTIONS}" ]; then + ARGS="${ARGS} --max-connections=${MAX_CONNECTIONS}" +fi + +git daemon --base-path=/git ${ARGS} |