fix: dockerized-services module image handling#1621
Merged
Conversation
0utplay
approved these changes
May 12, 2025
GiantTreeLP
pushed a commit
to GiantTreeLP/CloudNet
that referenced
this pull request
Jun 7, 2025
### Motivation The current docker module implementation is not able to handle custom registries correctly. This is due to 2 issues: 1. The registry was not correctly preprended to image names generated by `DockerImage#imageName` 2. The PullImageCmd construction used `PullImageCmd#withRegistry` which doesn't do anything (and never did something, the query option was never implemented in the docker api as far as I could tell) ### Modification 1. Fix `DockerImage#imageName` to correctly handle registries. I've also added support for SHA256 image digests to be used instead of image tags. Also added a test to validate that the outcome of `DockerImage#imageName` is valid. 2. No longer rely on `PullImageCmd#withRegistry`, supplying the full docker image name constructed by `DockerImage#imageName` is sufficient along with supplying the platform. 3. Supply the docker image platform to CreateContainerCmd to actually select the image for the requested platform. ### Result Custom docker registries and docker image platforms work as expected.
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.
Motivation
The current docker module implementation is not able to handle custom registries correctly. This is due to 2 issues:
DockerImage#imageNamePullImageCmd#withRegistrywhich doesn't do anything (and never did something, the query option was never implemented in the docker api as far as I could tell)Modification
DockerImage#imageNameto correctly handle registries. I've also added support for SHA256 image digests to be used instead of image tags. Also added a test to validate that the outcome ofDockerImage#imageNameis valid.PullImageCmd#withRegistry, supplying the full docker image name constructed byDockerImage#imageNameis sufficient along with supplying the platform.Result
Custom docker registries and docker image platforms work as expected.