概要
- やってみたけど、遅かった... (microSD, 100Mbps有線LAN..)
- 元: https://github.com/sameersbn/docker-apt-cacher-ng
- ↑に、ラズパイの変更を加えただけ。
環境
-
Raspberry Pi 3 model B
-
Docker
pi@rpi-07e7aa:~/apt-cacher-ng $ docker --version Docker version 17.10.0-ce, build f4ffd25
手順
-
Dockerを入れる
-
Docker 関連..
DockerfileFROM resin/rpi-raspbian:stretch ENV APT_CACHER_NG_CACHE_DIR=/var/cache/apt-cacher-ng \ APT_CACHER_NG_LOG_DIR=/var/log/apt-cacher-ng \ APT_CACHER_NG_USER=apt-cacher-ng RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y apt-cacher-ng \ && sed 's/# ForeGround: 0/ForeGround: 1/' -i /etc/apt-cacher-ng/acng.conf \ && sed 's/# PassThroughPattern:.*this would allow.*/PassThroughPattern: .* #/' -i /etc/apt-cacher-ng/acng.conf \ && rm -rf /var/lib/apt/lists/* COPY entrypoint.sh /sbin/entrypoint.sh RUN chmod 755 /sbin/entrypoint.sh EXPOSE 3142/tcp ENTRYPOINT ["/sbin/entrypoint.sh"] CMD ["/usr/sbin/apt-cacher-ng"]
ビルドwget https://raw.githubusercontent.com/sameersbn/docker-apt-cacher-ng/master/entrypoint.sh sudo docker build -t mt08/docker-apt-cache-ng .
実行cd ~ sudo docker run -d -p 3142:3142 -v `pwd`/apt-cacher-ng:/var/cache/apt-cacher-ng mt08/docker-apt-cache-ng # echo 'Acquire::http::Proxy "http://localhost:3142";' | sudo tee /etc/apt/apt.conf.d/02proxy sudo apt update
クライアント側設定(ホスト名は、各自変更)echo 'Acquire::http::Proxy "http://raspberrypi.local:3142";' | sudo tee /etc/apt/apt.conf.d/02proxy
- http://raspberrypi.local:3142/acng-report.html へアクセスすると統計がみれる