Hacker News new | ask | show | jobs
by rwky 651 days ago
It's not pretty but this works with docker images

``` FROM debian:bookworm ARG APT_CACHE RUN if [ ! -z "$APT_CACHE" ]; then \ echo 'Acquire::http { Proxy "'$APT_CACHE'"; };' >> /etc/apt/apt.conf.d/01proxy; \ fi && \ ... rest of your commands go here ... ```

Then run `docker build --build-arg APT_CACHE=http://aptcacheraddress:port`

If the build arg isn't set it will simply not use apt cacher and proceed as normal.