ning 39 Posted January 9, 2020 Share Posted January 9, 2020 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. 0 Quote Link to post Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.