Kubernetes: Unable to create repository

I’m following Kubernete’s getting started guide. Everything went smoothly until I ran

$ gcloud docker push gcr.io/<PROJECT ID>/hello-node:v1

  • Install docker on RedHatLinux 6.7
  • sudo service mongod start : mongod: unrecognized service
  • How to resolve docker host names (/etc/hosts) in containers
  • Is it possible to install a complex server inside a Docker container?
  • docker redis -Can't open the log file: No such file or directory
  • Docker: build with different results compared to manual step-by-step build
  • (Where is, well, my project id). For some reason, Kubernetes is not able to push to the registry. This is what I get:

    Warning: '--email' is deprecated, it will be removed soon. See usage.
    Login Succeeded
    Warning: '--email' is deprecated, it will be removed soon. See usage.
    Login Succeeded
    Warning: '--email' is deprecated, it will be removed soon. See usage.
    Login Succeeded
    Warning: '--email' is deprecated, it will be removed soon. See usage.
    Login Succeeded
    Warning: '--email' is deprecated, it will be removed soon. See usage.
    Login Succeeded
    Warning: '--email' is deprecated, it will be removed soon. See usage.
    Login Succeeded
    Warning: '--email' is deprecated, it will be removed soon. See usage.
    Login Succeeded
    The push refers to a repository [gcr.io/kubernetes-poc-1320/hello-node]
    18465c0e312f: Preparing 
    5f70bf18a086: Preparing 
    9f7afc4ce40e: Preparing 
    828b3885b7b1: Preparing 
    5dce5ebb917f: Preparing 
    8befcf623ce4: Waiting 
    3d5a262d6929: Waiting 
    6eb35183d3b8: Waiting 
    denied: Unable to create the repository, please check that you have access to do so.
    

    Any ideas on what I might be doing wrong? Note that I have run. $ gcloud init, so I’ve logged in.

    Thanks in advance!

  • Could i run docker in a docker Container Ubuntu 14.04
  • Don't see Django in Docker container
  • Run bash command before running container
  • rsync through ssh cannot find uppercase remote host (an other container in Docker)
  • AWS ECS running a task that requires many cores
  • ECS: Environment variables set in task but not present in container
  • 11 Solutions collect form web for “Kubernetes: Unable to create repository”

    This solved it in my case:


    Short version:

    Press Enable billing in the Container Engine screen in the https://console.cloud.google.com.


    Long version:

    In my case I got the error because of an issue with setting billing in the google cloud platform console.

    Although I entered all my credit card information and the screen of my Container Engine Screen in the google cloud platform console said Container Engine is getting ready. This may take a minute or more., it didn’t work before I pressed Enable billing on the same screen. Then the gcloud docker push command finally worked.

    Oddly enough after later returning to the Container Engine screen, it shows me Container Engine is getting ready. This may take a minute or more. and the button Enable billing again.. must be a bug in the console.

    None of the above solutions worked for me and I finally found out a solution. I’m using Windows 10 and looked at my C:/Users//.docker/config.json file and it looked like this.

    {
        "auths": {
            "https://appengine.gcr.io": {},
            "https://asia.gcr.io": {},
            "https://b.gcr.io": {},
            "https://bucket.gcr.io": {},
            "https://eu.gcr.io": {},
            "https://gcr.io": {},
            "https://gcr.kubernetes.io": {},
            "https://us.gcr.io": {}
        },
        "credsStore": "wincred"
    }
    

    Removing the “credsStore”: “wincred” line fixed the problem!

    I was getting this same error because I was accidentally using the project name rather than the auto-generated id. The PROJECT_ID can be found via:

    $ gcloud info
    

    as well as in the Google Cloud dashboard: https://console.cloud.google.com/home/dashboard

    Silly, I realize, but I can imagine others making the same mistake 🙂

    Ensure you are authenticated with Google Cloud.

    $ gcloud auth application-default login
    

    Double-check gcloud is pointing to your current project.

    $ gcloud config set project PROJECT_ID
    

    If you still have trouble, run gcloud info and take a look at the Last Log File. Note: gcloud auth login no longer writes application default credentials.

    In https://stackoverflow.com/a/39996807/598513 I answered switching user/account

    gcloud auth list
    gcloud config set account example@gmail.com
    

    Edit: This worked for me months ago. New versions of Kubernetes might not have this problem, or this solution might not solve it 🙂

    Ok, after struggling for hours with this, I finally managed to push it to th grc.io registry by changing my tag from a image:version notation to image/version, like this:

    gcloud docker push gcr.io/<PROJECT ID>/hello-node/v1

    after reading another guide from Kubernetes’ documentation: https://cloud.google.com/container-registry/docs/pushing#pushing_to_the_registry

    Hope this helps!

    run gcloud init and see whether you have logged in to the correct account. I once had this error because of i was trying to push image from different google account

    If you’re using a GCE instance, you need to make sure it has the right Cloud API access scope.
    Since you can’t edit the scopes on running instances, you can create a new instance using your current disk.

    To do that, do the following

    • Go to your instance page and click Edit
    • Uncheck Delete boot disk when instance is deleted and click save
    • Create a new instance using your previous disk and with write permissions on Storage.

    When using docker-credential-helpers to store docker credentials in the OSX Keychain, gcloud docker -- push $registry/$project_id/<image>:<tag> fails as well.

    Solution for me was to revert ~/.docker/config.json to not store credentials securely with the keychain

    See also: https://github.com/GoogleCloudPlatform/gcloud-common/issues/198

    For me, having the same error, I found I missed the “gcloud” in the beginning. That was because previous 2 commands started with docker and I just glanced over the changes after docker.

    ~/gs-spring-boot/complete$ docker -- push gcr.io/kubernetes-codelab-1xxxxx/hello-java:v1
    

    correct:

    ~/gs-spring-boot/complete$ gcloud docker -- push gcr.io/kubernetes-codelab-1xxxxx/hello-java:v1
    

    What do you use as a project id? It shouldn’t be “my-kubernetes-codelab”, it should be “my-kubernetes-codelab-234231” or whatever your numbered version is. This was my problem.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.