I have been trying to push my built image into ECR. My ECR credentials are configured in the docker integration settings. From there on I have been facing issues in the pushing step and looked everywhere to make sense of the error, unfortunately, I cannot find anything that helps.
The error message:
Failed to push image
Logs:
name unknown: The repository with name ‘farisology/fyp-rahman’ does not exist in the registry with id ‘551650907187’
I would appreciate it if someone can point to me my mistake and help clarify to me what am missing here.
Here is my yaml file:
version: "1.0"
#Stages can help you organize your steps in stages
stages:
- "clone"
- "build"
- "test"
- "push"
steps:
clone:
title: "Cloning repository"
type: "git-clone"
repo: "farisology/fyp-rahman"
# CF_BRANCH value is auto set when pipeline is triggered
# Learn more at codefresh.io/docs/docs/codefresh-yaml/variables/
revision: "${{CF_BRANCH}}"
git: "github"
stage: "clone"
build:
title: "Building Docker image"
type: "build"
image_name: "farisology/fyp-rahman"
working_directory: "${{clone}}"
tag: "${{CF_BRANCH_TAG_NORMALIZED}}"
dockerfile: "Dockerfile"
stage: "build"
test:
title: "Running test"
type: "freestyle" # Run any command
image: "ubuntu:latest" # The image in which command will be executed
working_directory: "${{clone}}" # Running command where code cloned
commands:
- "ls"
stage: "test"
Push:
type: "push"
arguments:
candidate: "${{build}}"
registry: "farisology"
stage: "push"
I am glad it worked out. Yes there is much flexibility on naming. By default the build step creates a default image name and the push step re-uses it. I think this case works for most registries but AWS might be a bit different.
As you found out you can override the name in the build step. But you can also override the name in the push step as well
The push step has an image_name that you can also use to customize the image name.
As a first step you should try to push manually to your registry from your terminal using the standard docker push commands.
If that works, and Codefresh cannot push you need to open a ticket with us and include the URL of the build that has the issue so that they can investigate.
The error you are posting is generic and can mean different things (no such registry, wrong name in image, incorrect permissions etc).
ok sure i will try
registry exists and that user has admin access
image name also right…
i will still go back and try pushing using docker push commands