{"id":13587952,"url":"https://github.com/sameersbn/docker-apt-cacher-ng","last_synced_at":"2025-05-16T13:08:58.336Z","repository":{"id":18212309,"uuid":"21348087","full_name":"sameersbn/docker-apt-cacher-ng","owner":"sameersbn","description":"Dockerfile to create a Docker container image for Apt-Cacher NG","archived":false,"fork":false,"pushed_at":"2025-02-04T04:24:05.000Z","size":124,"stargazers_count":225,"open_issues_count":18,"forks_count":76,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-15T12:58:46.169Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sameersbn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-06-30T10:55:20.000Z","updated_at":"2025-05-01T22:20:15.000Z","dependencies_parsed_at":"2023-02-17T14:15:46.833Z","dependency_job_id":"1306e30c-987b-4847-b6df-ce08f2d39aa3","html_url":"https://github.com/sameersbn/docker-apt-cacher-ng","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameersbn%2Fdocker-apt-cacher-ng","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameersbn%2Fdocker-apt-cacher-ng/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameersbn%2Fdocker-apt-cacher-ng/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameersbn%2Fdocker-apt-cacher-ng/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sameersbn","download_url":"https://codeload.github.com/sameersbn/docker-apt-cacher-ng/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535828,"owners_count":22087399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T15:06:26.394Z","updated_at":"2025-05-16T13:08:58.312Z","avatar_url":"https://github.com/sameersbn.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"[![apt-cacher-ng](https://github.com/sameersbn/docker-apt-cacher-ng/actions/workflows/build.yml/badge.svg)](https://github.com/sameersbn/docker-apt-cacher-ng/actions/workflows/build.yml)\n\n# sameersbn/apt-cacher-ng:3.7.4-20220421\n\n- [Introduction](#introduction)\n  - [Contributing](#contributing)\n  - [Issues](#issues)\n- [Getting started](#getting-started)\n  - [Installation](#installation)\n  - [Quickstart](#quickstart)\n  - [Command-line arguments](#command-line-arguments)\n  - [Persistence](#persistence)\n  - [Docker Compose](#docker-compose)\n  - [Usage](#usage)\n  - [Logs](#logs)\n- [Maintenance](#maintenance)\n  - [Cache expiry](#cache-expiry)\n  - [Upgrading](#upgrading)\n  - [Shell Access](#shell-access)\n\n# Introduction\n\n`Dockerfile` to create a [Docker](https://www.docker.com/) container image for [Apt-Cacher NG](https://www.unix-ag.uni-kl.de/~bloch/acng/).\n\nApt-Cacher NG is a caching proxy, specialized for package files from Linux distributors, primarily for [Debian](http://www.debian.org/) (and [Debian based](https://en.wikipedia.org/wiki/List_of_Linux_distributions#Debian-based)) distributions but not limited to those.\n\n## Contributing\n\nIf you find this image useful here's how you can help:\n\n- Send a pull request with your awesome features and bug fixes\n- Help users resolve their [issues](../../issues?q=is%3Aopen+is%3Aissue).\n- Support the development of this image with a [donation](http://www.damagehead.com/donate/)\n\n## Issues\n\nBefore reporting your issue please try updating Docker to the latest version and check if it resolves the issue. Refer to the Docker [installation guide](https://docs.docker.com/installation) for instructions.\n\nSELinux users should try disabling SELinux using the command `setenforce 0` to see if it resolves the issue.\n\nIf the above recommendations do not help then [report your issue](../../issues/new) along with the following information:\n\n- Output of the `docker version` and `docker info` commands\n- The `docker run` command or `docker-compose.yml` used to start the image. Mask out the sensitive bits.\n- Please state if you are using [Boot2Docker](http://www.boot2docker.io), [VirtualBox](https://www.virtualbox.org), etc.\n\n# Getting started\n\n## Installation\n\nAutomated builds of the image are available on [Dockerhub](https://hub.docker.com/r/sameersbn/apt-cacher-ng) and is the recommended method of installation.\n\n\u003e **Note**: Builds are also available on [Quay.io](https://quay.io/repository/sameersbn/apt-cacher-ng)\n\n```bash\ndocker pull sameersbn/apt-cacher-ng:3.7.4-20220421\n```\n\nAlternatively you can build the image yourself.\n\n```bash\ndocker build -t sameersbn/apt-cacher-ng github.com/sameersbn/docker-apt-cacher-ng\n```\n\n## Quickstart\n\nStart Apt-Cacher NG using:\n\n```bash\ndocker run --name apt-cacher-ng --init -d --restart=always \\\n  --publish 3142:3142 \\\n  --volume /srv/docker/apt-cacher-ng:/var/cache/apt-cacher-ng \\\n  sameersbn/apt-cacher-ng:3.7.4-20220421\n```\n\n*Alternatively, you can use the sample [docker-compose.yml](docker-compose.yml) file to start the container using [Docker Compose](https://docs.docker.com/compose/)*\n\n## Command-line arguments\n\nYou can customize the launch command of Apt-Cacher NG server by specifying arguments to `apt-cacher-ng` on the `docker run` command. For example the following command prints the help menu of `apt-cacher-ng` command:\n\n```bash\ndocker run --name apt-cacher-ng --init -it --rm \\\n  --publish 3142:3142 \\\n  --volume /srv/docker/apt-cacher-ng:/var/cache/apt-cacher-ng \\\n  sameersbn/apt-cacher-ng:3.7.4-20220421 -h\n```\n\n## Persistence\n\nFor the cache to preserve its state across container shutdown and startup you should mount a volume at `/var/cache/apt-cacher-ng`.\n\n\u003e *The [Quickstart](#quickstart) command already mounts a volume for persistence.*\n\nSELinux users should update the security context of the host mountpoint so that it plays nicely with Docker:\n\n```bash\nmkdir -p /srv/docker/apt-cacher-ng\nchcon -Rt svirt_sandbox_file_t /srv/docker/apt-cacher-ng\n```\n\n## Docker Compose\n\nTo run Apt-Cacher NG with Docker Compose, create the following `docker-compose.yml` file\n\n```yaml\n---\nversion: '3'\n\nservices:\n  apt-cacher-ng:\n    image: sameersbn/apt-cacher-ng\n    container_name: apt-cacher-ng\n    ports:\n      - \"3142:3142\"\n    volumes:\n      - apt-cacher-ng:/var/cache/apt-cacher-ng\n    restart: always\n\nvolumes:\n  apt-cacher-ng:\n```\n\nThe Apt-Cache NG service can then be started in the background with:\n\n```bash\ndocker-compose up -d\n```\n\n## Usage\n\nTo start using Apt-Cacher NG on your Debian (and Debian based) host, create the configuration file `/etc/apt/apt.conf.d/01proxy` with the following content:\n\n```config\nAcquire::HTTP::Proxy \"http://172.17.0.1:3142\";\nAcquire::HTTPS::Proxy \"false\";\n```\n\nSimilarly, to use Apt-Cacher NG in you Docker containers add the following line to your `Dockerfile` before any `apt-get` commands.\n\n```dockerfile\nRUN echo 'Acquire::HTTP::Proxy \"http://172.17.0.1:3142\";' \u003e\u003e /etc/apt/apt.conf.d/01proxy \\\n \u0026\u0026 echo 'Acquire::HTTPS::Proxy \"false\";' \u003e\u003e /etc/apt/apt.conf.d/01proxy\n```\n\n## Logs\n\nTo access the Apt-Cacher NG logs, located at `/var/log/apt-cacher-ng`, you can use `docker exec`. For example, if you want to tail the logs:\n\n```bash\ndocker exec -it apt-cacher-ng tail -f /var/log/apt-cacher-ng/apt-cacher.log\n```\n\n# Maintenance\n\n## Cache expiry\n\nUsing the [Command-line arguments](#command-line-arguments) feature, you can specify the `-e` argument to initiate Apt-Cacher NG's cache expiry maintenance task.\n\n```bash\ndocker run --name apt-cacher-ng --init -it --rm \\\n  --publish 3142:3142 \\\n  --volume /srv/docker/apt-cacher-ng:/var/cache/apt-cacher-ng \\\n  sameersbn/apt-cacher-ng:3.7.4-20220421 -e\n```\n\nThe same can also be achieved on a running instance by visiting the url http://localhost:3142/acng-report.html in the web browser and selecting the **Start Scan and/or Expiration** option.\n\n## Upgrading\n\nTo upgrade to newer releases:\n\n  1. Download the updated Docker image:\n\n  ```bash\n  docker pull sameersbn/apt-cacher-ng:3.7.4-20220421\n  ```\n\n  2. Stop the currently running image:\n\n  ```bash\n  docker stop apt-cacher-ng\n  ```\n\n  3. Remove the stopped container\n\n  ```bash\n  docker rm -v apt-cacher-ng\n  ```\n\n  4. Start the updated image\n\n  ```bash\n  docker run --name apt-cacher-ng --init -d \\\n    [OPTIONS] \\\n    sameersbn/apt-cacher-ng:3.7.4-20220421\n  ```\n\n## Shell Access\n\nFor debugging and maintenance purposes you may want access the containers shell. If you are using Docker version `1.3.0` or higher you can access a running containers shell by starting `bash` using `docker exec`:\n\n```bash\ndocker exec -it apt-cacher-ng bash\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsameersbn%2Fdocker-apt-cacher-ng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsameersbn%2Fdocker-apt-cacher-ng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsameersbn%2Fdocker-apt-cacher-ng/lists"}