Skip to content

Commit e26e113

Browse files
committed
fix(Docker): Fixed the DockerContainerPlatform to pull images by tag instead of always fetching latest
Signed-off-by: Charles d'Avernas <[email protected]>
1 parent 45deaf1 commit e26e113

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/Synapse.Core.Infrastructure.Containers.Docker/DockerContainerPlatform.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ public virtual async Task<IContainer> CreateAsync(ContainerProcessDefinition def
8383
catch (DockerApiException ex) when (ex.StatusCode == HttpStatusCode.NotFound)
8484
{
8585
var downloadProgress = new Progress<JSONMessage>();
86-
await this.DockerClient.Images.CreateImageAsync(new() { FromImage = definition.Image }, new(), downloadProgress, cancellationToken).ConfigureAwait(false);
86+
var imageComponents = definition.Image.Split(':');
87+
var imageName = imageComponents[0];
88+
var imageTag = imageComponents.Length > 1 ? imageComponents[1] : null;
89+
await this.DockerClient.Images.CreateImageAsync(new() { FromImage = imageName, Tag = imageTag }, new(), downloadProgress, cancellationToken).ConfigureAwait(false);
8790
}
8891
var parameters = new CreateContainerParameters()
8992
{

0 commit comments

Comments
 (0)