Skip to content

Fix mirror.list location and nginx config #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

FROM debian:buster-slim

RUN apt update
RUN apt install gcc make perl wget rsync --no-install-recommends -y
RUN apt-get update && apt-get dist-upgrade -yq
RUN apt-get install gcc make perl wget rsync --no-install-recommends -y
RUN apt-get autoclean -yq && apt-get autoremove -yq

WORKDIR /apt-mirror
COPY ./apt-mirror /apt-mirror
COPY ./.perltidyrc /apt-mirror
COPY ./Makefile /apt-mirror
COPY ./mirror.list /apt-mirror
COPY ./mirror.list /etc/apt
COPY ./postmirror.sh /apt-mirror

RUN make
Expand Down
2 changes: 2 additions & 0 deletions default_settings.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
UID=1000
GID=1000
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ services:

mirror:
build: .
user: ${UID}:${GID}
command: bash -c "apt-mirror && bash /apt-mirror/postmirror.sh"
volumes:
- "./mirror:/var/spool/apt-mirror"
- "./mirror.list:/etc/apt/mirror.list"
- "./postmirror.sh:/apt-mirror/postmirror.sh"

server:
build:
Expand All @@ -17,4 +20,4 @@ services:
volumes:
- "./mirror/mirror:/mirror:ro"
ports:
- "8080:80"
- "80:80"
20 changes: 6 additions & 14 deletions mirror.list
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set var_path $base_path/var
set postmirror_script $var_path/postmirror.sh
set defaultarch amd64
set run_postmirror 0
set nthreads 6
set nthreads 8
set limit_rate 100m
set _tilde 0
# Use --unlink with wget (for use with hardlinked directories)
Expand All @@ -15,16 +15,8 @@ set http_proxy 127.0.0.1:3128
set proxy_user user
set proxy_password password

deb http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse
clean http://archive.ubuntu.com/ubuntu

# ==
# Example of other repos
# ==

# deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main
# deb https://download.docker.com/linux/ubuntu bionic stable
# deb https://apt.kubernetes.io kubernetes-bionic main
deb http://us.archive.ubuntu.com/ubuntu jammy main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu jammy-security main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu jammy-updates main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse
clean http://us.archive.ubuntu.com/ubuntu
13 changes: 10 additions & 3 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ server {
listen *:80;
server_name _;

root /mirror;
autoindex on;
}
location / {
root /mirror;
autoindex on;
}

location /ubuntu {
root /mirror/us.archive.ubuntu.com;
autoindex on;
}
}