-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When building image, use layer cache from pulled image #19
Comments
@regisb Your recent fix reminded me of this issue. No rush, but I'm curious if you have thoughts on this. |
Would adding the following lines to the docker-compose-dev.yml template help?
Can you please try whether this improves the situation? (see docker-compose cache_from reference) |
I need to put this down for today, but here's what I've found so far... SystemUbuntu 20.04 on AMD64 SetupThere were a few steps I had to take before Compose would even consider using the openedx image as a cache:
Test# Clear out most of your Docker cache for accurate results
tutor local start -d lms # ensure that your openedx image is in use
docker system prune -af # remove all unused images, cache layers, etc
tutor local stop
# Ensure openedx image is up-to-date
tutor images pull openedx
# Try building the openedx-dev image
tutor dev dc build lms My resultHere's the first portion of the openedx-dev build:
Interestingly I see the line:
Unfortunately, the build stlil took a long time, and involved a lot of scrolling text that the fancy new buildx CLI hides. So I don't think any of the cached image layers were used. If I run the same command again, I get:
Notice that this second invocation shows |
one idea I had in my mind is to explicitly define an image tree in tutor which would allow to rebuild a given image from a chosen stage.without relying entirely on docker. I am interested in digging into this matter when I have some time, too. |
Should we keep this issue open? After all, we are really not supposed to build images with |
Yes, I believe this is fixed. |
Background
When I run:
it pulls
openedx:VERSION
from Dockerhub. Docker reuses any image layers that are already in the cache, and it's a no-op if I already have the latest image downloaded. Great.When I run:
it builds
openedx-dev:VERSION
, but it will not reuse the image layers pulled fromopenedx:VERSION
, even thoughopenedx
shares several dozen layers withopenedx-dev
! It will start right from Step 1 at the top of the Dockerfile. That makes the build take way more time and bandwidth than it needs to.Tasks
TBD
The text was updated successfully, but these errors were encountered: