Skip to content

Commit 777ef31

Browse files
authored
Merge pull request #385 from serverlessworkflow/fix-docker-image-tag
Fix the DockerContainerPlatform to pull images by tag
2 parents 45deaf1 + e26e113 commit 777ef31

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)