Skip to content

Latest commit

 

History

History
83 lines (58 loc) · 2.3 KB

setting-up-a-docker-registry.md

File metadata and controls

83 lines (58 loc) · 2.3 KB

Setting Up A Docker Registry

This document explains how to use different Docker registries with Knative Serving. It assumes you have gone through the steps listed in DEVELOPMENT.md to set up your development environment (or that you at least have installed go, set GOPATH, and put $GOPATH/bin on your PATH).

It currently only contains instructions for Google Container Registry (GCR), but you should be able to use any Docker registry.

Google Container Registry (GCR)

Required Tools

Install the following tools:

  1. gcloud

  2. docker-credential-gcr

    If you installed gcloud using the archive or installer, you can install docker-credential-gcr like this:

    gcloud components install docker-credential-gcr

    If you installed gcloud using a package manager, you may need to install it with go get:

    go get github.com/GoogleCloudPlatform/docker-credential-gcr

    If you used go get to install and $GOPATH/bin isn't already in PATH, add it:

    export PATH=$PATH:$GOPATH/bin

Setup

  1. If you haven't already set up a GCP project, create one and export its name for use in later commands.

    export PROJECT_ID=my-project-name
    gcloud projects create "${PROJECT_ID}"
  2. Enable the GCR API.

    gcloud --project="${PROJECT_ID}" services enable \
    containerregistry.googleapis.com
  3. Hook up your GCR credentials. Note that this may complain if you don't have the docker CLI installed, but it is not necessary and should still work.

    docker-credential-gcr configure-docker
  4. If you need to, update your KO_DOCKER_REPO and/or DOCKER_REPO_OVERRIDE in your .bashrc. It should now be

    export KO_DOCKER_REPO='us.gcr.io/<your-project-id>'
    export DOCKER_REPO_OVERRIDE="${KO_DOCKER_REPO}"

    (You may need to use a different region than us if you didn't pick aus Google Cloud region.)

That's it, you're done!

Local registry

This section has yet to be written. If you'd like to write it, see issue #23.