Pull private docker images from Google Container Registry w/o gcloud

后端 未结 1 1473
刺人心
刺人心 2020-12-29 10:48

I\'m using shippable to push private docker images to the Google Container Registry that I then want to pull from either locally on a laptop, or inside an instance on the Go

相关标签:
1条回答
  • 2020-12-29 11:49

    If you want to work with the Google Container Registry on a machine not in the Google Compute Engine (i.e. local) using vanilla docker you can follow Google's instructions.

    The two main methods are using an access token or a JSON key file.

    Note that _token and _json_key are the actual values you provide for the username (-u)

    Access Token

    $ docker login -e 1234@5678.com -u _token -p "$(gcloud auth print-access-token)" https://gcr.io
    

    JSON Key File

    $ docker login -e 1234@5678.com -u _json_key -p "$(cat keyfile.json)" https://gcr.io
    

    To create a key file you can follow these instructions:

    1. Open the Credentials page.
    2. To set up a new service account, do the following:
      • Click Add credentials > Service account.
      • Choose whether to download the service account's public/private key as a standard P12 file, or as a JSON file that can be loaded by a Google API client library.
      • Your new public/private key pair is generated and downloaded to your machine; it serves as the only copy of this key. You are responsible for storing it securely.

    You can view Google's documentation on generating a key file here.

    0 讨论(0)
提交回复
热议问题