Skip to content

Commit

Permalink
# This is a combination of 4 commits.
Browse files Browse the repository at this point in the history
# This is the 1st commit message:

updated readme

# This is the commit message #2:

updated readme

# This is the commit message #3:

updated readme

# This is the commit message #4:

updated readme
  • Loading branch information
modem7 committed Sep 28, 2022
1 parent 5ea05da commit e146d57
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Build Status](https://drone.modem7.com/api/badges/modem7/docker-apt-cacher-ng/status.svg)](https://drone.modem7.com/modem7/docker-apt-cacher-ng)
[![GitHub last commit](https://img.shields.io/github/last-commit/modem7/docker-apt-cacher-ng)](https://github.com/modem7/docker-apt-cacher-ng)

Docker image for apt-cacher-ng based off of debian:bullseye-slim
Docker image for apt-cacher-ng.

---

Expand Down Expand Up @@ -34,7 +34,7 @@ The `latest` tag has multi-arch support for `amd64`, and `arm64` and will automa

## Example usage

```
```bash
docker run -d \
--name apt-cacher-ng \
-p 3142:3142 \
Expand All @@ -44,7 +44,7 @@ docker run -d \
```

## Docker Compose example
```
```yaml
################
#APT-Cacher-NG##
################
Expand All @@ -70,24 +70,24 @@ This image runs `apt-cacher-ng`, `cron`, and `rsyslogd` to ensure that apt-cache

In order to configure a host to make use of apt-cacher-ng on a box, you should create a file on the host `/etc/apt/apt.conf` with the following lines:

```
```bash
Acquire::http::Proxy "http://<docker-host>:3142";
```

Or a one liner for Debian/Ubuntu hosts:
```
```bash
echo "Acquire::http::Proxy \"http://<docker-host>:3142\";" | sudo tee /etc/apt/apt.conf.d/00proxy
```

You can also bypass the apt caching server on a per client basis by using the following syntax in your `/etc/apt/apt.conf` file:

```
```bash
Acquire::HTTP::Proxy::<repo-url> "DIRECT";
```

For example:

```
```bash
Acquire::HTTP::Proxy::get.docker.com "DIRECT";
Acquire::HTTP::Proxy::download.virtualbox.org "DIRECT";
```
Expand All @@ -96,9 +96,29 @@ Note: The above assumes that you are mapping port 3142 on the docker host and 3

You can also update the /etc/apt-cacher-ng/acng.conf and add one or more `PassThroughPattern` lines to force clients to bypass a repository:

```
```bash
PassThroughPattern: get\.docker\.com
PassThroughPattern: download\.virtualbox\.org
```

## Getting https://download.docker.com to cache
If you want to cache your Docker.com downloads, you'll need to change the repo to http.

For example, if you're following the [Ubuntu install](https://docs.docker.com/engine/install/ubuntu/) instructions, you'll need to do change the following:
Instead of
```bash
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
```

Change to:
```bash
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] http://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
```

---

Based on the work from [mbentley](https://github.com/mbentley/docker-apt-cacher-ng) and [sameersbn](https://github.com/sameersbn/docker-apt-cacher-ng).

0 comments on commit e146d57

Please sign in to comment.