update README.md

This commit is contained in:
Terry Chen 2017-04-27 14:50:33 +08:00
parent 7d36d0fd8d
commit 4b6c881695
1 changed files with 13 additions and 20 deletions

View File

@ -3,29 +3,22 @@
[![Docker Stars](https://img.shields.io/docker/stars/seterrychen/apt-mirror-http-server.svg)](https://hub.docker.com/r/seterrychen/apt-mirror-http-server/) [![Docker Stars](https://img.shields.io/docker/stars/seterrychen/apt-mirror-http-server.svg)](https://hub.docker.com/r/seterrychen/apt-mirror-http-server/)
[![Docker Pulls](https://img.shields.io/docker/pulls/seterrychen/apt-mirror-http-server.svg)](https://hub.docker.com/r/seterrychen/apt-mirror-http-server/) [![Docker Pulls](https://img.shields.io/docker/pulls/seterrychen/apt-mirror-http-server.svg)](https://hub.docker.com/r/seterrychen/apt-mirror-http-server/)
Base on Ubuntu, using Docker to construct your Apt mirror HTTP server Using Docker to construct your APT(Advanced Packaging Tools) mirror HTTP server.
## Usage ## Usage
Running command ### Basic command:
```
docker run -v /path/data:/var/spool/apt-mirror \
-v /path/your/mirror.list:/etc/apt/mirror.list \
-e TIMEOUT=timeout-value \
-d -p port_number:80 seterrychen/apt-mirror-http-server
```
/path/data is where to store data, and the TIMEOUT var to repeatedly execute apt-mirror.
If you don't setting variable of mirror.list and TIMEOUT, it will using the [default mirror.list](mirror.list), and
the default TIMEOUT is 12 hours. To see the [TIMEOUT format description](http://www.cyberciti.biz/faq/linux-unix-sleep-bash-scripting/).
Or running command
``` ```
docker run -v /path/data:/var/spool/apt-mirror \ docker run -d \
-e MIRROR_URL=http://tw.archive.ubuntu.com/ubuntu \ -v /path/data:/var/spool/apt-mirror \
-e TIMEOUT=timeout-value \ -p 8080:80 seterrychen/apt-mirror-http-server
-d -p port_number:80 seterrychen/apt-mirror-http-server
``` ```
MIRROR_URL can used to replace apt sources of [default mirror.list](mirror.list)
## Note * `-v /path/data`: the path which you want to store data
It will take time to download, then start http server. Using ``docker logs -f container-id`` to check the process.
### More options with docker command
* `-v /path/your/mirror.list:/etc/apt/mirror.list`: to replace [Ubuntu default mirror.list](https://github.com/seterrychen/apt-mirror-http-server/blob/master/mirror.list)
* `-e MIRROR_URL=http://tw.archive.ubuntu.com/ubuntu`: to overwrite the mirror.list when you use this option to specific the mirror site
* `-e TIMEOUT=timeout-value`: to set the resync period, default is 12 hours. To set the [TIMEOUT format description](http://www.cyberciti.biz/faq/linux-unix-sleep-bash-scripting/)