forked from bodsch/alpine-package-mirror
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
70 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
repo/ | ||
packages/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.*.swp | ||
packages/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
|
||
# | ||
# Run lighttpd to serve apk packages | ||
# | ||
FROM alpine:3.2 | ||
MAINTAINER Daniel Nephin <dnephin@gmail.com> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
mirror: | ||
image: alpine-package-mirror:latest | ||
volumes_from: ['data'] | ||
|
||
data: | ||
image: alpine-package-data:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# | ||
# Run rsync to periodically update package data, and share it as a volume | ||
# | ||
FROM alpine:3.2 | ||
MAINTAINER Daniel Nephin <dnephin@gmail.com> | ||
|
||
RUN apk update && apk add rsync | ||
RUN mkdir -p /var/www/localhost/htdocs/alpine | ||
|
||
ADD rsync.sh /etc/periodic/hourly/package-rsync | ||
RUN echo "echo doing stuff" > /etc/periodic/15min/doit | ||
RUN chmod +x /etc/periodic/15min/doit | ||
|
||
VOLUME /var/www/localhost/htdocs/alpine | ||
CMD ["crond", "-f", "-d", "6"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
# make sure we never run 2 rsync at the same time | ||
lockfile="/tmp/alpine-mirror.lock" | ||
if [ -z "$flock" ] ; then | ||
exec env flock=1 flock -n $lockfile $0 "$@" | ||
fi | ||
|
||
src=rsync://rsync.alpinelinux.org/alpine/ | ||
dest=/var/www/localhost/htdocs/alpine/ | ||
|
||
/usr/bin/rsync -prua \ | ||
--exclude "v2.[1-9]" \ | ||
--exclude "v3.0" \ | ||
--exclude "v3.1" \ | ||
--delete \ | ||
--timeout=120 \ | ||
--delay-updates \ | ||
--delete-after \ | ||
"$src" "$dest" |