Jump to content

apt cache for docker build


ning

Recommended Posts

the main proposal of this research is to enable cached apt archives for docker build.

 

first apt cache can be saved by a docker volume, but due to `${SDCARD}/var/cache/apt/archives` is not a constant, then we can't use `-v=apt-cache:${SDCARD}/var/cache/apt/archives` to enable it.

 

so I use `-v=apt-cache:/root/.apt` as a tmp place for apt cache, when need `apt install` in `${SDCARD}`, use `mount -o bind /root/.apt ${SDCARD}/var/cache/apt/archives` and after install finishes, `umount ${SDCARD}/var/cache/apt/archives`

 

this looks perfect, but after I check /root/.apt, everything is gone.

 

I double checked whether *.deb are saved to /root/.apt, I can find them before `umount`, or even use apt-cache in another container: `docker run --privileged --rm -v=apt-cache:/test -it ubuntu:18.04 bash` I can find debs in /test folder, and gone after `umount`

 

I really don't know why.

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines