-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (31 loc) · 948 Bytes
/
Dockerfile
File metadata and controls
39 lines (31 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM alpine:edge
LABEL maintainer="sixarms1leg"
LABEL name="git-ssh"
LABEL description="Git over SSH with UID/GID handling"
RUN apk add --no-cache \
git \
openssh
WORKDIR /git/
# The git-shell permits execution only of server-side Git commands implementing
# the pull/push functionality, plus custom commands present in a subdirectory
# named `git-shell-commands` in the user’s home directory.
# [More info](https://git-scm.com/docs/git-shell)
COPY ./git-shell-commands/ ./git-shell-commands/
COPY ./fix-repos.sh ./sshd_config ./
COPY ./start.sh /
COPY ./check.sh /
RUN echo '' > /etc/motd && \
chmod u+x \
./git-shell-commands/* \
./fix-repos.sh \
/start.sh \
/check.sh && \
mkdir -p \
./.ssh/ \
./keys-host/ \
./keys/ \
./repos/
EXPOSE 22
VOLUME ["/git/keys-host/", "/git/keys/", "/git/repos/"]
HEALTHCHECK CMD sh /check.sh
CMD ["sh", "/start.sh"]