Hey, started using pulumi yesterday to set up our ...
# getting-started
v
Hey, started using pulumi yesterday to set up our startup app, works fine so far, but I have some questions:
Copy code
image = awsx.ecr.Image(
    "xxx-image",
    awsx.ecr.ImageArgs(
        repository_url=xxx_repo.url, context="../../",
        cache_from=[
            pulumi.Output.concat(xxx_repor.url, ":latest")
        ],
        dockerfile="../../apps/xxx/Dockerfile", 
        image_name="xxx",
        image_tag="latest",
        platform="linux/amd64"
    ),
)
I cannot get the cache from to work, its always rebuilding the image and this makes up takes some time, also when i take a look at ecr I'm getting What would be the best flow for production application, should I separate build and push to ecr and only keep in pulumi ref to the build image (eg tag or something?) Basically wondering on how to handle deployments with CI/CD, building and all that stuff.
m
You can separate the build from the push by using
awsx.RegistryImage
as in this example. As noted in the comment in line 11, you don't have to build the image through Pulumi, it just has to be available locally. So if you already have the image building with caching etc. figured out, that's probably your easiest path forward.