(aws-ecr-assets): TarballImageAsset Fails in Stage
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 74
Description
### Describe the bug
The `TarballImageAsset` construct fails when it is nested inside of a `Stack` that is also inside of a `Stage`. Moving that `Stack` outside of the `Stage` works around the issue.
### Expected Behavior
The `TarballImageAsset` should push the image to ECR.
### Current Behavior
The failure occurs when `TarballImageAsset` attempts to shell out to `docker load`.
> [78%] fail: docker tag .dkr.ecr..amazonaws.com/cdk--container-assets--: exited with error code 1: Error parsing reference: "" is not a valid repository/tag: invalid reference format
### Reproduction Steps
```java
class MyStack extends Stack {
public MyStack(final Construct scope, final String id) {
super(scope, id);
new TarballImageAsset(
this, "image", TarballImageAssetProps.builder().tarballFile("./my-image.tar").build());
}
}
class MyStage extends Stage {
public MyStage(final Construct scope, final String id) {
super(scope, id);
new MyStack(this, "stack");
}
}
```
### Possible Solution
_No response_
### Additional Information/Context
_No response_
### CDK CLI Version
2.70.0 (build c13a0f1)
### Framework Version
2.70.0
### Node.js Version
v19.8.1
### OS
macOS 13.2.1
### Language
Java
### Language Version
17.0.6
### Other information
Consider sending requests to the Docker daemon without shelling out to the Docker CLI to get more descriptive errors and avoid issues like #19627.
Contributor guide
Research direction
Start by reproducing the Java example with CDK 2.70.0 and trace the TarballImageAsset path that shells out to docker load and docker tag when a Stack is nested in a Stage. Done means the image is pushed to ECR in that nesting arrangement and a regression test covers it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, docker, java, typescript
- Domain
- cloud, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100