I'm pretty new to IBM Cloud and Code Engine. I am trying to deploy an app called "project1" by uploading a docker container to IBM Cloud Container Registry and using it for a Code Engine application.
The problem is, the app creation always fails with this message (the namespace is project_namespace):
"Revision "project1-00001" failed with message: Unable to fetch image "icr.io/project1_namespace/project1": failed to resolve image to digest: GET https:/. See https://ibm.biz/BdPKqq; Authorization required. See https://ibm.biz/BdPKqq."
or sometimes this message:
"Revision "project1-00001" failed with message: Unable to fetch image "icr.io/project1_namespace/project1": failed to resolve image to digest: GET https://icr.io/oauth/token?scope=repository%!A(MISSING)project1_namespace%!F(MISSING)project1%!A(MISSING)pull&service=registry: UNAUTHORIZED: Authorization required. See https://ibm.biz/BdPKqq; Authorization required. See https://ibm.biz/BdPKqq."
I don't understand why authentication would be failing here. Here is what I do:
ibmcloud login
ibmcloud cr login
docker build -t $DOCKER_IMAGE_NAME $DOCKERFILE_PATH
ibmcloud target -g $RESOURCE_GROUP_NAME
ibmcloud cr namespace-add $REGISTRY_NAMESPACE
ibmcloud ce project create --name project1
ibmcloud ce project select -n project1
docker tag $DOCKER_IMAGE_NAME icr.io/$REGISTRY_NAMESPACE/${DOCKER_IMAGE_NAME}:latest
docker push icr.io/$REGISTRY_NAMESPACE/${DOCKER_IMAGE_NAME}:latest
ibmcloud ce app create --name $CODE_ENGINE_APP_NAME --image icr.io/$REGISTRY_NAMESPACE/$DOCKER_IMAGE_NAME
Code Engine application should pull the icr.io image sucessfully. Right?