Using the new Docker v4 and ECR, I keep getting “i...
# aws
p
Using the new Docker v4 and ECR, I keep getting “invalid reference format”:
Copy code
error: error: invalid reference format. This provider requires all image names to be fully qualified.
    For example, if you are attempting to push to Dockerhub, prefix your image name with `<http://docker.io|docker.io>`:

    `<http://docker.io/repository/image:tag|docker.io/repository/image:tag>`
(I’m migrating from old tech, so I don’t know what I’m doing wrong). Technical details in 🧵
My createImage code isn’t particularly complicated:
Copy code
const createImage = (registryId: pulumi.Output<string>) => {
    const registryToken = aws.ecr.getAuthorizationTokenOutput({ registryId });

    return registryToken.apply((registry) => {
      
      const recorderImage = new docker.Image('recorder', {
        imageName: `${imageName}:${imageVersion}`,
        build: {
          context: SERVICE_PATH,
          platform: 'linux/amd64',
        },
        registry,
      });
      return recorderImage.imageName;
    });
  };
For
imageName
I’ve tried: •
registry.proxyEndpoint
• ``${registry.proxyEndpoint}/${imageName}:${imageVersion}`` • ``${imageName}:${imageVersion}`` None of them worked.
b
theres some deets in the v4 release notes, are any of those helpful to you? https://github.com/pulumi/pulumi-docker/releases/tag/v4.0.0
p
Okay, so if I strip the
https://
off of the
registry.proxyEndpoint
and use that like so:
Copy code
<http://111111111111.dkr.ecr.us-west-1.amazonaws.com/recorder:1.0.21|111111111111.dkr.ecr.us-west-1.amazonaws.com/recorder:1.0.21>
then it goes on, but now it’s seems to be failing with credentials being wrong. I’m trying this:
Copy code
registry: {
          server: '<http://111111111111.dkr.ecr.us-west-1.amazonaws.com|111111111111.dkr.ecr.us-west-1.amazonaws.com>',
          username: 'AWS',
          password: registry.password,
        },
Does that look right?
I just tried adding
/recorder
on to the end of server to see if that made a difference, negative.
c
I’ve been using
awsx.ecr
for repository and image to build and push. Not sure if that’s helpful but it’s working for us.
p
I eventually sorted things out. Basically, the sample code I had was incorrect and I needed to use different values in all of the locations in order to make it work.
s
@polite-umbrella-11196, did that sample code come from the Pulumi docs or any Pulumi-authored examples? If so, it would be helpful to know so that we can work to correct them.