Help us understand the problem. What is going on with this article?

[メモ] らずぱいで、apt-cacher-ngのサーバをDockerにて

More than 1 year has passed since last update.

概要

環境

  • Raspberry Pi 3 model B
  • Docker

    pi@rpi-07e7aa:~/apt-cacher-ng $ docker --version
    Docker version 17.10.0-ce, build f4ffd25
    

手順

  1. Dockerを入れる
  2. Docker 関連..

    Dockerfile
    FROM 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
    
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした