-
Notifications
You must be signed in to change notification settings - Fork 168
/
Dockerfile
40 lines (28 loc) · 1.1 KB
/
Dockerfile
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
40
###
# After building (eg. `docker build -t gitlab-mirrors .`) ...
# you are expected to formulate a `docker run` command like the following:
#
# docker run -ti \
# --volume /path/to/config.sh:/home/gitmirror/gitlab-mirrors/config.sh:ro \
# --volume /path/to/ssh-keys:/home/gitmirror/.ssh \
# --volume /path/to/repositories:/home/gitmirror/repositories \
# gitlab-mirrors \
# <gitlab-mirrors cmd> <cmd options> # eg. add_mirror.sh --help
###
FROM debian:10
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -yqq \
python-pip \
git
RUN pip install python-gitlab
RUN adduser --shell /bin/sh --disabled-password --gecos "" gitmirror
RUN mkdir /home/gitmirror/gitlab-mirrors
COPY . /home/gitmirror/gitlab-mirrors
RUN chown -R gitmirror:gitmirror /home/gitmirror
USER gitmirror
WORKDIR /home/gitmirror/gitlab-mirrors
RUN mkdir /home/gitmirror/repositories && \
chmod 755 /home/gitmirror/gitlab-mirrors/*.sh
ENV PATH=$PATH:/home/gitmirror/gitlab-mirrors
ENTRYPOINT [ "/bin/bash", "/home/gitmirror/gitlab-mirrors/scripts/docker/entrypoint.sh" ]