Dockerd wrapper housekeeping#4267
Merged
idelvall merged 2 commits intoearthly:eliottwiener-gridunity/dockerd-wrapper-housekeepingfrom Aug 6, 2024
Merged
Conversation
Forcing the removal prevents 'unable to remove repository reference' errors when the image is still being used by a container. In this case, it is acceptable to remove the repository reference, and continue script execution.
When using a cached data-root, it is possible that some undesired docker objects have been left behind from a previous execution. In these cases, we should remove the unnecessary docker objects prior to executing the RUN. This change assumes that the intention of the --docker-cache feature is only to retain image layers between executions, and that it is not intended to retain volumes, networks, or containers.
453df49
into
earthly:eliottwiener-gridunity/dockerd-wrapper-housekeeping
idelvall
added a commit
that referenced
this pull request
Aug 6, 2024
When using a self-hosted satellite with the `--docker-cache` experimental feature enabled, it was found that leftover bad state in the cached data-root could cause builds to start failing. In particular, a leftover, stopped container making use of one of the images that the `dockerd-wrapper.sh` attempts to `rmi` would result in a `unable to remove repository reference` error. Some additional debugging revealed that other types of docker objects are potentially left behind in the data-root. This change modifies the `docker-wrapper.sh` to do some housekeeping of these undesirable objects, and also makes changes to avoid having builds fail due to unanticipated leftover state. Co-authored-by: eliottwiener-gridunity <134441321+eliottwiener-gridunity@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using a self-hosted satellite with the
--docker-cacheexperimental feature enabled, it was found that leftover bad state in the cached data-root could cause builds to start failing. In particular, a leftover, stopped container making use of one of the images that thedockerd-wrapper.shattempts tormiwould result in aunable to remove repository referenceerror. Some additional debugging revealed that other types of docker objects are potentially left behind in the data-root. This change modifies thedocker-wrapper.shto do some housekeeping of these undesirable objects, and also makes changes to avoid having builds fail due to unanticipated leftover state.