Environment variables are set up properly. But running apk update for instance just hangs. It looks like an upstream issue. If so, point where to file it.
Turned out that {http,https}_proxy variables must contain scheme, not only host and port. So setting http_proxy=proxy.example.com won't work but http_proxy=http://proxy.example.com will do.
Where do you put the proxy url? Could you specify file and command format please?
apk update still fails with a timeout for me, despite having carefully entered the protocol in all proxy variables.
(And that proxy variable setting works for all other Linux distributions I use.)
This is Alpine Linux v3.13.0 with BusyBox v1.32.1.
Our proxy uses port 8080. Could it be that apk does not process the port?
ex:
export http_proxy='http://proxy.example.com:8080'
Note that BusyBox's wget does not work either. Contrary to apk, it does not time out, but fails with error:
/tmp # wget https://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz
Connecting to proxy.example.com:8080 (1.2.3.4:8080)
wget: server returned error: HTTP/1.1 400 Bad Request
/tmp #
Again, wget (The real one though) works in all other distributions I've used.
it seems there is a problem with newest wget https request over a http-proxy
I worked around this bug by using http repositories instead of https
sed -i.bak 's+https://+http://+' /etc/apk/repositories
Most helpful comment
Turned out that
{http,https}_proxyvariables must contain scheme, not only host and port. So settinghttp_proxy=proxy.example.comwon't work buthttp_proxy=http://proxy.example.comwill do.