gentle-state-12755
03/15/2023, 9:31 PM@pulumi/docker
v4.0.0:
The example below shows how to create and push a Docker Image with tag xyz
, but how can I tag the image with a secondary TAG latest
?
const demoImage = new docker.Image("demo-image", {
build: {
context: ".",
dockerfile: "Dockerfile",
},
imageName: "host/image:xyz"
});
The desired result is to being able to publish both:
• host/image:latest
• host/image:xyz
docker.Tag
resource, without success
new docker.Tag("demo-tag", {
sourceImage: "host/image:xyz",
targetImage: "host/image:latest",
}, {
dependsOn: [
demoImage,
],
});
billowy-army-68599
03/15/2023, 10:29 PMconst demoImage = new docker.Image("demo-image", {
build: {
context: ".",
dockerfile: "Dockerfile",
},
imageName: "test/image:bar",
skipPush: true,
});
new docker.Tag("demo-tag", {
sourceImage: demoImage.imageName as pulumi.Output<string>, // ensure the optional type is string
targetImage: "test/image:foo",
});
stocky-restaurant-98004
03/15/2023, 10:33 PMgentle-state-12755
03/15/2023, 10:51 PMfoo
is created correctly
But how to push foo
remotely together with bar
?
const demoImage = new docker.Image("demo-image", {
build: {
context: ".",
dockerfile: "Dockerfile",
},
imageName: "host/image:bar",
registry: {...},
});
new docker.Tag("demo-tag", {
sourceImage: demoImage.imageName as pulumi.Output<string>,
targetImage: "test/image:foo",
});
The bar
tag is found in the remote repository host
, but not the foo
tagbillowy-army-68599
03/15/2023, 10:56 PMgentle-state-12755
03/15/2023, 10:58 PMconst demoImage = new docker.Image("demo-image", {
build: {
context: ".",
dockerfile: "Dockerfile",
},
imageName: "host/image",
tags: [
'foo',
'bar'
],
registry: {...},
});
billowy-army-68599
03/15/2023, 11:01 PMgentle-state-12755
03/15/2023, 11:02 PMbillowy-army-68599
03/16/2023, 5:15 PMconst demoImage = new docker.Image("demo-image", {
build: {
context: ".",
dockerfile: "Dockerfile",
},
imageName: "test/image:bar",
skipPush: true,
});
const demoImageTag = new docker.Image("demo-image-tag", {
imageName: "test/image:foo",
skipPush: true,
build: {
context: ".",
dockerfile: "Dockerfile",
}
})
Let the underlying docker caching do the workgentle-state-12755
03/16/2023, 5:18 PMdependOn
the other. If not, is docker going to try to build them in parallel ?billowy-army-68599
03/16/2023, 5:19 PM