2.4 KiB
Setting Up A Docker Registry
This document explains how to use different Docker registries with Elafros. 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:
-
If you installed
gcloudusing the archive or installer, you can installdocker-credential-gcrlike this:gcloud components install docker-credential-gcrIf you installed
gcloudusing a package manager, you may need to install it withgo get:go get github.com/GoogleCloudPlatform/docker-credential-gcrIf you used
go getto install and$GOPATH/binisn't already inPATH, add it:export PATH=$PATH:$GOPATH/bin
Setup
-
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}" -
Enable the GCR API.
gcloud --project="${PROJECT_ID}" services enable \ containerregistry.googleapis.com -
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 -
If you need to, update your
DOCKER_REPO_OVERRIDEin your.bashrc. It should now beexport DOCKER_REPO_OVERRIDE='us.gcr.io/<your-project-id>'(You may need to use a different region than
usif you didnt pick aus` Google Cloud region.) -
You may need to run
bazel cleanafter updating yourDOCKER_REPO_OVERRIDEenvironment variable forbazelto pick up the change.
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.