summaryrefslogtreecommitdiff
blob: 7948ca88cffb0efa25a0463aac8a0c07008929bf (plain)
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
# image is based on stage3-amd64
FROM gentoo/stage3-amd64:latest
COPY rsyncd.conf /opt/rsync/rsyncd.conf
COPY wrap_rsync.sh /opt/rsync/wrap_rsync.sh

# Normally I would advocate for ARG here and pass arguments to wrap_rsync.
# This would enable new docker builds with arguments like:
# docker build . --build_arg WAIT_TIME=30m -t gentoo/rsync
# However, ARG's cannot be passed to ENTRYPOINTs, so we set these as ENV instead.
# Mirror to get data from.
ENV SOURCE_MIRROR=rsync://turnstone.gentoo.org./gentoo-portage
# ENV SOURCE_MIRROR=rsync://rsync.us.gentoo.org/gentoo-portage
# Where to write the data in this container.
ENV DEST_DIR=/srv/gentoo
# How long to wait between syncs; must be a valid argument to sleep
ENV WAIT_TIME=30m

# This needs to exist in the container.
WORKDIR $DEST_DIR

# Expose Rsync port
EXPOSE 873

CMD mount -t tmpfs -o size=2g,nr_inodes=2000000 tmpfs /srv/gentoo

ENTRYPOINT /opt/rsync/wrap_rsync.sh