Adding an image registry in Codewind in Che

Prerequisite: Determining if you need an image registry

1. First, determine if you need to add an image registry. The following scenarios in Codewind require you to specify which image registry is in use:

  • In the following scenario, configure Codewind with an image registry to push the application image to that specific image registry:
    • Run Codewind on a remote Kubernetes cluster, including Che, to develop a Codewind style project.
  • In the following scenario, configure Codewind to use the credentials for a specific image registry:
    • Run Codewind on a remote Kubernetes cluster, including Che, to develop an Appsody style project.
    • The image registry for the Appsody stack requires credentials.
  • In the following scenario, from the command line, enter the docker login command in the registry before you create the Appsody project:
    • Run Codewind locally to develop an Appsody style project.
    • The image registry for the Appsody stack requires credentials. If you do not develop any Codewind style projects, and you use an image registry that does not require credentials, you do not need to specify an image registry. 2. If you do need to add an image registry, start and run Che.

Adding an image registry in Codewind

After Che is started and running, add the image registry to be used with Codewind.

  1. From the Codewind Project Explorer view, right-click Projects and select Image Registry Manager.
  2. From the Image Registry Manager, click Add New.
  3. Enter the following information to add the registry:
    • Registry server name or domain name: <registry-to-push-images-to>
    • User name: <Your username>
    • Password or API key: <Your password or API key>
  4. If you’re using the newly added registry as a push registry, enter the namespace that you want to push your images to.
    • For recommended values for common registries, see the examples.
  5. Click Select a Push Registry to determine which registry you use to push Codewind style projects to.

Codewind image registry guidance

When you run Codewind on Kubernetes for Codewind style projects, Codewind uses buildah to build container images from Dockerfiles and to push the images to an image registry that you specify. Use the Image Registry Manager in your Codewind IDE to configure the registry to use.

Use any registry as long as buildah and the node that Codewind is running on can resolve the registry hostname. If buildah cannot resolve the registry hostname, buildah cannot push your projects to the registry, and deployment on Kubernetes is prevented.

Examples:

These examples show recommended values for common registries. The following deployment registries are tested and verified with Codewind:

  • Docker Hub:
    • Address: docker.io
    • Namespace: <namespace>
    • Credentials: Docker Hub user name and password or access token
    • Note: For Docker Hub, the Namespace value is likely to be your user name.
  • Quay.io:
    • Address: https://quay.io
    • Namespace: <namespace>
    • Credentials: Quay.io user name and encrypted password
  • Artifactory
    • Address: <artifactory-hostname>
    • Namespace: <namespace>
    • Credentials: Artifactory user name and access token
  • OpenShift Registry
    • Address: docker-registry.default.svc:5000
    • Namespace: <project>
    • Credentials: OpenShift user name and access token

Adding registries to OKD and OpenShift

To use the OpenShift internal container registry with Codewind, see Adding the OpenShift internal registry with Codewind.

Next step: Creating a Codewind workspace in Che