question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[aws-ecr-assets] DockerImageAsset: Specify image tag

See original GitHub issue

We are using a DockerImageAsset with an ECS ContainerDefinition, and would like to build, tag, and deploy an image from a build-specific tag (ie not latest).

I see that #2334 made deploy-time context hashes from the image available recently. Is there a way to accomplish this with these? I’m getting stuck trying, and can’t seem to specify an image sha in the container definition, only a tag.

Would it make sense to tag+push DockerImageAsset with these hashes and/or user provided tags? https://github.com/awslabs/aws-cdk/blob/master/packages/aws-cdk/lib/docker.ts#L64

I’d be happy to open a PR if this is a welcome feature! Also, thank you for this great tooling, its been a pleasure to work with on my projects recently 💯

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:50
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

19reactions
luxaritascommented, Jan 5, 2021

Additional point: without lifecycle policies (#6692), and since specifying a repository name is now deprecated in lieu of using a cdk-wide repository, there is currently no way to tell my images apart whatsoever - all I see are commit hashes. I have no viable way of cleaning up unused resources.

6reactions
rareelementcommented, Jul 22, 2021

@eladb Is cdk-ecr-deployment officially supported by AWS?

Anyways, it is not going to help with my use case of keeping aws-cdk/assets repository slim, unless the expectation is that aws-cdk/assets repository will be regularly completely cleaned (which is not realistic in most companies with multiple teams/services). This, now closed issue, is different from #12597.

If ECR supports multiple image tags, I don’t see why CDK cannot support those as well and why AWS users have to incur additional costs by duplicating docker images.

Read more comments on GitHub >

github_iconTop Results From Across the Web

class DockerImageAsset (construct) · AWS CDK
Specify this property if you need to statically address the image, e.g. from a Kubernetes Pod. Note, this is only the repository name,...
Read more >
CDK ECR: How to set repository name and tag - Stack Overflow
const image = new DockerImageAsset(this, 'CDKDockerImage', { directory: path.join(__dirname, ... Tag and deploy the image to the repo.
Read more >
[aws-ecr-assets] DockerImageAsset: Specify image tag
[aws-ecr-assets] DockerImageAsset: Specify image tag. awslabs. 28 May 2019 Posted by nason. We are using a DockerImageAsset with an ECS ContainerDefinition ...
Read more >
@aws-cdk/aws-ecr-assets - npm
import { DockerImageAsset } from '@aws-cdk/aws-ecr-assets'; ... The recommended setting for Docker image assets is IgnoreMode.DOCKER .
Read more >
@aws-cdk/aws-ecr-assets | Yarn - Package Manager
Images are built from a local Docker context directory (with a Dockerfile ), uploaded to Amazon Elastic Container Registry (ECR) by the CDK...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found