[aws-ecr-assets] DockerImageAsset: Specify image tag
See original GitHub issueWe 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:
- Created 4 years ago
- Reactions:50
- Comments:15 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
@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.