Hi! I am not sure if this is the right channel to ...
# general
s
Hi! I am not sure if this is the right channel to ask the following question. I am setting up a new docker build using
@pulumi/docker-build
. I am using aws conainter registry. When I run
pulumi preview
I am getting the following error:
Copy code
Diagnostics:
  docker-build:index:Image (api-docker-image):
    error: Resource type 'docker-build:index:Image' not found.
Here is the snippet of the code:
Copy code
this.image = new docker_build.Image(
      `${args.buildType}-docker-image`,
      {
        tags: [pulumi.interpolate`${this.repository.repositoryUrl}:${args.commitHash}_${Date.now()}`],
        push: true,
        buildOnPreview: args.buildOnPreview,
        dockerfile: {
          location: args.dockerfile,
        },
        context: {
          location: args.buildContext, 
        },
        buildArgs: {
          ...args.dockerBuildArgs,
          BUILDKIT_INLINE_CACHE: '1', // This will enable buildkit to use cache
        },
        cacheFrom: [{
          registry: { ref: pulumi.interpolate`${this.repository.repositoryUrl}:cache` },
        }],
        cacheTo: [{
          registry: { ref: pulumi.interpolate`${this.repository.repositoryUrl}:cache` },
        }],
        platforms: [docker_build.Platform.Linux_amd64],
        registries: [{
          address: this.repository.repositoryUrl,
          username: token.apply(token => token.userName),
          password: pulumi.secret(token.apply(token => token.password)),
        }],
      },
      { provider: args.provider, parent: this.repository, dependsOn: [this.repository] },
    );
I am not sure what this error is? Previously I was using the
@pulumi/docker
to build and push images to aws ecr and it was working fine. Right now, i am setting up a new repository on aws ECR using the docker-build and runnign into this error. thank you.
i
Hey there, here's a working example (https://github.com/pulumi/examples/blob/master/aws-ts-containers-dockerbuild/index.ts#L32) similar to what you're trying to achieve. I'd start there and compare the solution to yours.
s
The error was due to having the custom provider. Since, I am pushing the image to another AWS account i am using the registries so i do not need the provider. Thank you for the reply.