This commit is contained in:
		
							parent
							
								
									3e27d9bf26
								
							
						
					
					
						commit
						4ff75ed861
					
				| @ -2,6 +2,7 @@ FROM phusion/baseimage:0.11 | |||||||
| 
 | 
 | ||||||
| VOLUME /var/mirror | VOLUME /var/mirror | ||||||
| 
 | 
 | ||||||
|  | ENV MIRROR_INTERVAL_SECONDS 43200 | ||||||
| ENV MIRROR_ARCHITECTURES amd64 | ENV MIRROR_ARCHITECTURES amd64 | ||||||
| ENV UBUNTU_SOURCE_MIRROR | ENV UBUNTU_SOURCE_MIRROR | ||||||
| ENV MIRROR_CATEGORIES main,universe,restricted,multiverse | ENV MIRROR_CATEGORIES main,universe,restricted,multiverse | ||||||
|  | |||||||
| @ -1,36 +1,41 @@ | |||||||
| # sneak/ubuntumirror | # sneak/ubuntumirror | ||||||
| 
 | 
 | ||||||
| Docker container for syncing bionic ubuntu LTS mirrors | Docker image for syncing ubuntu LTS mirrors to reduce network traffic and | ||||||
| to reduce network traffic and speed up build times. | speed up build times. | ||||||
| 
 | 
 | ||||||
| Then even your builds (where you can't specify links) will go fast. | Then even your builds (where you can't specify links to other containers by | ||||||
|  | hostname) will go fast. | ||||||
| 
 | 
 | ||||||
| # Levers | # Levers | ||||||
| 
 | 
 | ||||||
|  | ## Environment Variables | ||||||
|  | 
 | ||||||
| * `MIRROR_ARCHITECTURES` | * `MIRROR_ARCHITECTURES` | ||||||
|     * default `amd64`. |     * default `amd64`. | ||||||
|     * You may want `i386,amd64`. |     * You may want `i386,amd64`. | ||||||
| * `MIRROR_CATEGORIES` | * `MIRROR_CATEGORIES` | ||||||
|     * default `main,universe`. |     * Default `main,universe,restricted,multiverse`. Will use lots of disk. | ||||||
|     * You may want `main,universe,restricted,multiverse`. Will use lots of |     * You may want `main,universe`. | ||||||
|       disk. |  | ||||||
| * `UBUNTU_MIRROR_PROJECTS` | * `UBUNTU_MIRROR_PROJECTS` | ||||||
|     * default `xenial,xenial-updates,xenial-security,xenial-backports,bionic,bionic-updates,bionic-security,bionic-backports`. |     * Default | ||||||
| * `UBUNTU_MIRROR_SOURCE` |       `bionic,bionic-updates,bionic-security,bionic-backports,focal,focal-updates,focal-security,focal-backports`. | ||||||
|  |     * You may want only `focal,focal-updates,focal-security,focal-backports`. | ||||||
|  | * `UBUNTU_MIRROR_SOURCE` - upstream server to mirror from | ||||||
|     * default `archive.ubuntu.com`. |     * default `archive.ubuntu.com`. | ||||||
|     * You may want `xx.archive.ubuntu.com` (where `xx` is your country |     * You may want `xx.archive.ubuntu.com` (where `xx` is your country | ||||||
|       code). |       code). | ||||||
| * `MIRROR_INTERVAL_SECONDS` - mirror sync interval | * `UBUNTU_SOURCE_MIRROR` - do we want to mirror all the source code too? | ||||||
|  |     * Default `` | ||||||
|  |     * You may want `1` if you want to use up even more disk for your mirror | ||||||
|  | * `MIRROR_INTERVAL_SECONDS` - mirror update interval | ||||||
|     * default `43200` (12h) |     * default `43200` (12h) | ||||||
|     * You may want `10800` (3h) |     * You may want `10800` (3h) | ||||||
| 
 | 
 | ||||||
| # Example dnsmasq setup | # Example CapRover Definition File | ||||||
| 
 | 
 | ||||||
| ``` | ``` | ||||||
| apt update && apt -y install dnsmasq |  { | ||||||
| echo address=/mirrors.ubuntu.com/172.17.0.1 > /etc/dnsmasq.d/ubuntu-mirror-local |   "schemaVersion": 2, | ||||||
|  |   "imageName": "sneak/ubuntumirror:latest" | ||||||
|  | } | ||||||
| ``` | ``` | ||||||
| 
 |  | ||||||
| Then, just add `--dns 172.17.0.1` to your /etc/default/docker opts |  | ||||||
| and bounce the docker daemon.  Future containers will talk to your local |  | ||||||
| mirror. |  | ||||||
|  | |||||||
| @ -6,8 +6,8 @@ export HOME=/root | |||||||
| # cleanup previous runs | # cleanup previous runs | ||||||
| rm -rf /var/mirror/ubuntu/.temp | rm -rf /var/mirror/ubuntu/.temp | ||||||
| 
 | 
 | ||||||
| while true ; do | while sleep 1 ; do | ||||||
|     cd /opt/mirror && make |     cd /opt/mirror && make | ||||||
| 
 | 
 | ||||||
|     sleep ${MIRROR_INTERVAL_SECONDS:-43200} |     sleep ${MIRROR_INTERVAL_SECONDS} | ||||||
| done | done | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user