Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECR Image: push without build #1203

Open
mattfysh opened this issue Jan 11, 2024 · 2 comments
Open

ECR Image: push without build #1203

mattfysh opened this issue Jan 11, 2024 · 2 comments
Assignees
Labels
kind/enhancement Improvements or new features

Comments

@mattfysh
Copy link

Hello!

  • Vote on this issue by adding a 馃憤 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

Currently the image being pushed to ECR must be also built by Pulumi, which is a rather uncommon setup in projects where the build steps are separated from the deployment steps. The schema of the resource allows for no build args to be provided, but fails when it cannot locate a Dockerfile

It would be great if there were a way to push an image to the ECR registry if it has already been built and tagged on the local host.

See pulumi/pulumi-docker#54 for a similar discussion on the docker provider. It is suggested that if no build is required, a docker.RegistryImage should be created instead of docker.Image

Affected area/feature

A possible solution is to support an imageName input for the Image, and branch the internal logic based on its presence:

import * as awsx from "@pulumi/awsx";
const repository = new awsx.ecr.Repository("repository", {
    forceDelete: true,
});
const image = new awsx.ecr.Image("image", {
    repositoryUrl: repository.url,
    imageName: 'my-locally-built-image',
});
@mjeffryes
Copy link
Contributor

Thanks for this suggestion @mattfysh; we've been talking a bit about this use case in the context of some of our docker work too recently. We'll try to think about how to enable this scenario in awsx as well. cc @blampe

@mjeffryes mjeffryes removed the needs-triage Needs attention from the triage team label Jan 12, 2024
@mattfysh
Copy link
Author

mattfysh commented Jan 28, 2024

let me know if this is off topic, but I was looking into the implementation of ecr.Image and noticed that a new image is built and pushed on each program run only because aws.ecr.getCredentialsOutput will return new credentials each time.

If (for example) the same creds token was returned then pulumi wouldn't invoke the resource, so a new image wouldn't be built/pushed even if the (files referenced by) context or Dockerfile has changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

3 participants