jandelgado / lede-dockerbuilder

A (container based) LEDE/OpenWrt image builder.
Apache License 2.0
59 stars 20 forks source link

Cache packages #15

Closed andrewgodman closed 3 years ago

andrewgodman commented 4 years ago

Hi, I know this is might be an issue with LEDE/Openwrt's build tools but each build requires a download of every package.

I'd love to provide a solution but I wasn't able to find one without some sort of http proxy.

andrewgodman commented 4 years ago

I was able to do this by adding the following variable to the docker file and running a proxy. Maybe this isn't such an issue but downloads can take 5 mins for a simple build in Australia.

ENV http_proxy "http://host.docker.internal:8080"

Would be interested in anyone else who might have feedback :)

jandelgado commented 4 years ago

Hi, in fact, the OpenWRT packages are currently not cached and re-loaded each time a new OpenWRT image is built. I did some quick experiments and there are 2 easy options to cache the packages:

I'll come up with conrcrete examples later this weekend ...

andrewgodman commented 4 years ago

@jandelgado sounds good. Squid works well but I might see if I can mount /dl as a volume.

jandelgado commented 4 years ago

Release 2.4 allows to pass additional options to docker-run. This can be used to mount the downloads (dl) directory externally:

./builder.sh build example-nexx-wt3020.conf --docker-opts "-v=$(pwd)/dl:/lede/imagebuilder/dl:z"

See #18

andrewgodman commented 4 years ago

I'll check it out. My internet was finally upgraded so it may be less of an issue for me.