Tell us about your request
I would like to have a new command in Dockerfile (let's say it's called VALIDATE_CACHE), which is attached to a previous RUN command. If the previous RUN was cached, docker would run the command specified in a temporary layer to validate the cached image and if the result is SUCCESS it would discard the layer and continue, otherwise it would rerun the previous RUN without cache. This is useful to implement a cached package repository update command like apt update for Debian/Ubuntu. For example:
A more elaborate method can be used to only invalidate the cache when specified packages are upgraded.
Which service(s) is this request for?
Docker
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
Currently, either the apt update will be cached and later apt get will use an outdated cache or it takes quite long to run apt update every time.
Are you currently working around the issue?
Best workaround so far is to have apt update && before every apt get command, but this wouldn't upgrade packages automatically.
Tell us about your request I would like to have a new command in Dockerfile (let's say it's called
VALIDATE_CACHE
), which is attached to a previousRUN
command. If the previousRUN
was cached, docker would run the command specified in a temporary layer to validate the cached image and if the result is SUCCESS it would discard the layer and continue, otherwise it would rerun the previousRUN
without cache. This is useful to implement a cached package repository update command likeapt update
for Debian/Ubuntu. For example:A more elaborate method can be used to only invalidate the cache when specified packages are upgraded.
Which service(s) is this request for? Docker
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? Currently, either the
apt update
will be cached and laterapt get
will use an outdated cache or it takes quite long to runapt update
every time.Are you currently working around the issue? Best workaround so far is to have
apt update &&
before everyapt get
command, but this wouldn't upgrade packages automatically.Additional context N/A