This message was deleted.
# typescript
s
This message was deleted.
g
I tried using the
docker.Tag
resource, without success
Copy code
new docker.Tag("demo-tag", {
    sourceImage: "host/image:xyz",
    targetImage: "host/image:latest",
  }, {
    dependsOn: [
      demoImage,
    ],
  });
b
this works for me
Copy code
const 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",
  });
s
@gentle-state-12755 Is this a multi-platform image? If so, that's why it might not work.
g
@billowy-army-68599 I see what is happening. you are right, locally the tag
foo
is created correctly But how to push
foo
remotely together with
bar
?
Copy code
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
tag
b
We might need to make tag an array,‘could you file an issue
g
sure thing. just to make sure I get what you are talking about: you suggest a change to support something like ?
Copy code
const demoImage = new docker.Image("demo-image", {
    build: {
        context: ".",
        dockerfile: "Dockerfile",
    },
    imageName: "host/image",
    tags: [
      'foo',
      'bar'
    ],
    registry: {...},
});
b
Or an array for imageName
g
b
it occured to me last night @gentle-state-12755 the right way is probably this
Copy code
const 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 work
g
yes, but I guess one should
dependOn
the other. If not, is docker going to try to build them in parallel ?
b
yeah that’d work