initial
This commit is contained in:
commit
967dffa798
|
@ -0,0 +1,21 @@
|
|||
FROM phusion/baseimage:0.9.17
|
||||
|
||||
VOLUME /var/mirror
|
||||
|
||||
RUN echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y run-one nginx make debmirror
|
||||
|
||||
ADD ./mirror /opt/mirror
|
||||
ADD ./mirror.run /etc/service/mirror/run
|
||||
ADD nginx.conf /etc/nginx/nginx.conf
|
||||
ADD ./nginx.run /etc/service/nginx/run
|
||||
|
||||
RUN chmod +x /etc/service/nginx/run && \
|
||||
chmod +x /etc/service/mirror/run
|
||||
|
||||
RUN \
|
||||
gpg --import /usr/share/keyrings/ubuntu-archive-keyring.gpg && \
|
||||
gpg --import /usr/share/keyrings/ubuntu-master-keyring.gpg
|
||||
|
||||
EXPOSE 80
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
cd /opt/mirror && make
|
||||
sleep 21600
|
|
@ -0,0 +1,6 @@
|
|||
.PHONY: mirror
|
||||
|
||||
default: mirror
|
||||
|
||||
mirror:
|
||||
run-one-until-success bash mirror.sh
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
THISDIR="$(cd $(dirname "$BASH_SOURCE") && pwd -P)"
|
||||
DST="/var/mirror"
|
||||
|
||||
debmirror \
|
||||
-a i386,amd64 \
|
||||
--no-source \
|
||||
-s main,restricted,universe,multiverse \
|
||||
-h ${UBUNTU_MIRROR_SOURCE:-archive.ubuntu.com}
|
||||
-d trusty,trusty-updates,trusty-security,trusty-backports \
|
||||
-d xenial,xenial-updates,xenial-security,xenial-backports \
|
||||
-r /ubuntu \
|
||||
--progress \
|
||||
--method=http \
|
||||
$DST/ubuntu
|
||||
|
||||
chmod -R a+rX $DST/ubuntu
|
|
@ -0,0 +1,41 @@
|
|||
user daemon;
|
||||
worker_processes auto;
|
||||
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
sendfile on;
|
||||
keepalive_timeout 10;
|
||||
gzip off;
|
||||
|
||||
# default, no host name
|
||||
server {
|
||||
|
||||
listen 80 default_server;
|
||||
charset utf-8;
|
||||
|
||||
server_name _;
|
||||
|
||||
root /var/empty;
|
||||
|
||||
index index.html index.htm;
|
||||
|
||||
location / {
|
||||
deny all;
|
||||
}
|
||||
|
||||
location /ubuntu/ {
|
||||
root /var/mirror/ubuntu;
|
||||
autoindex on;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue