Skip to content

fix: dockerized-services module image handling#1621

Merged
derklaro merged 1 commit into
nightlyfrom
dockerized-services-image-handling
May 12, 2025
Merged

fix: dockerized-services module image handling#1621
derklaro merged 1 commit into
nightlyfrom
dockerized-services-image-handling

Conversation

@derklaro
Copy link
Copy Markdown
Member

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.

@derklaro derklaro added this to the 4.0.0-RC12 milestone May 11, 2025
@derklaro derklaro requested a review from 0utplay May 11, 2025 15:40
@derklaro derklaro self-assigned this May 11, 2025
@derklaro derklaro added v: 4.X This pull should be included in the 4.0 release t: fix A pull request introducing a fix for a bug. in: module An issue/pull request releated to one of the internal modules labels May 11, 2025
@derklaro derklaro changed the title fix: dockerized-services image handling fix: dockerized-services module image handling May 11, 2025
@derklaro derklaro merged commit 252acce into nightly May 12, 2025
7 checks passed
@derklaro derklaro deleted the dockerized-services-image-handling branch May 12, 2025 17:28
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: module An issue/pull request releated to one of the internal modules t: fix A pull request introducing a fix for a bug. v: 4.X This pull should be included in the 4.0 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants