I would like to use apt-cacher as my package proxy locally. Especially when I rebuilding my Docker image several times in a row. I have apt-cacher installed and running on my system.
I set my proxy address to: http://melroy-pc:3142 (melroy-pc is my hostname). In my case I create a /etc/apt/apt.conf.d/02proxy file:
Acquire::http::proxy "http://melroy-pc:3142";
Acquire::https::proxy "http://melroy-pc:3142";
(I already tried to only define http::proxy (without https), I also tried to add APT::Get::AllowUnauthenticated "true";, all WITHOUT any luck)
After which I just run my apt commands (apt update & apt install). Which causes issues now:
Step 9/41 : RUN apt-get update && apt-get install -y --no-install-recommends dirmngr gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm libassuan0 libksba8 libldap-2.4-2 libldap-common libnpth0 libreadline8 libsasl2-2 libsasl2-modules libsasl2-modules-db libsqlite3-0 libssl1.1 lsb-base pinentry-curses readline-common apt-transport-https ca-certificates curl software-properties-common apt-utils net-tools
---> Running in af278cee1d52
Err:1 http://deb.debian.org/debian bullseye InRelease
403 Access to cache prohibited [IP: 192.168.2.166 3142]
Err:2 http://security.debian.org/debian-security bullseye-security InRelease
403 Access to cache prohibited [IP: 192.168.2.166 3142]
Err:3 http://deb.debian.org/debian bullseye-updates InRelease
403 Access to cache prohibited [IP: 192.168.2.166 3142]
Reading package lists...
E: The repository 'http://deb.debian.org/debian bullseye InRelease' is not signed.
E: Failed to fetch http://deb.debian.org/debian/dists/bullseye/InRelease 403 Access to cache prohibited [IP: 192.168.2.166 3142]
E: Failed to fetch http://security.debian.org/debian-security/dists/bullseye-security/InRelease 403 Access to cache prohibited [IP: 192.168.2.166 3142]
E: The repository 'http://security.debian.org/debian-security bullseye-security InRelease' is not signed.
E: Failed to fetch http://deb.debian.org/debian/dists/bullseye-updates/InRelease 403 Access to cache prohibited [IP: 192.168.2.166 3142]
E: The repository 'http://deb.debian.org/debian bullseye-updates InRelease' is not signed.
Important note: My packages are all getting successfully installed, without any issues, when I do NOT use the proxy.
This approach used to work in the past, when I was using apt-key instead of gpg (I don't know if it's related, see my other question).