When I use custom image hosted in AWS ECR as Dockerfile base image in pipeline it fails to pull. The pipeline is configured to use OpenID. Moreover, the same image is successfully used as pipeline image step.
The pipeline example:
image:
name: {aws-account-id}.dkr.ecr.us-east-1.amazonaws.com/vs-openjdk:21
aws:
oidc-role: $AWS_OIDC_ROLE_ARN
defaults: &oidc_step_config
oidc: true
image:
name: {aws-account-id}.dkr.ecr.us-east-1.amazonaws.com/vs-openjdk:21
aws:
oidc-role: $AWS_OIDC_ROLE_ARN
pipelines:
branches:
main:
- step:
<<: *oidc_step_config
name: Build Executable Jar
script:
- ./gradlew test bootJar
artifacts:
- build/libs/{java-application-name}.jar
- step:
<<: *oidc_step_config
name: Build & Publish Docker Image
script:
- docker build -t $IMAGE_NAME:$BITBUCKET_BUILD_NUMBER .
- pipe: atlassian/aws-ecr-push-image:2.4.2
variables:
AWS_OIDC_ROLE_ARN: $AWS_OIDC_ROLE_ARN
IMAGE_NAME: $IMAGE_NAME
TAGS: $BITBUCKET_BUILD_NUMBER
services:
- docker
caches:
- docker
The shorten example of Dockerfile
```
FROM {aws-account-id}.dkr.ecr.us-east-1.amazonaws.com/vs-openjdk:21
WORKDIR /usr/server/
...
```
Why does it fail on FROM step of Dockerfile build? When I use public image it runs well.