Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 25 additions & 37 deletions docs/_documentations/dockerregistry.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
layout: docs
title: Docker registry guidance for Eclipse Codewind
description: Docker registry guidance for Eclipse Codewind
keywords: users, projects, Kubernetes, docker, containers, registry, deployment, push
title: Image registry guidance for Eclipse Codewind
description: Image registry guidance for Eclipse Codewind
keywords: users, projects, Kubernetes, image, registry, deployment, push
duration: 5 minutes
permalink: dockerregistry
type: document
Expand All @@ -11,52 +11,40 @@ order: 1
---
# Codewind Docker registry guidance

When you run Codewind on Kubernetes, Codewind uses [`buildah`](https://github.com/containers/buildah) to build container images from Dockerfiles and then push the images to a container registry that you specify.
When you run Codewind on Kubernetes for Codewind style projects, Codewind uses [`buildah`](https://github.com/containers/buildah) to build container images from Dockerfiles and to push the images to an image registry that you specify. You can use the `Image Registry Manager` in your Codewind IDE to configure the registry to use.

Codewind is flexible with the registry that can be used as long as `buildah` and the node that Codewind is running on can resolve the registry hostname. If `buildah` is unable to resolve the registry hostname, `buildah` will be unable to push your projects to the registry and will prevent deployment on Kubernetes.
Codewind is flexible with the registry that can be used as long as `buildah` and the node that Codewind is running on can resolve the registry hostname. If `buildah` is unable to resolve the registry hostname,`buildah` is unable to push your projects to the registry, and deployment on Kubernetes is prevented.

Before you proceed, see the [examples](#examples) section on recommended values for common registries:

## Examples:
The following deployment registries have been tested and verified with Codewind:
- Dockerhub:
- Host: `docker.io`
- Codewind deployment registry: `docker.io/<username>`
- Credentials: Dockerhub user name and password
- Docker Hub:
- Address: `docker.io`
- Namespace: `<namespace>`
- Credentials: Docker Hub username and password or token access
- Quay.io:
- Host: `https://quay.io`
- Codewind deployment registry: `https://quay.io/<username>`
- Address: `https://quay.io`
- Namespace: `<namespace>`
- Credentials: Quay.io user name and encrpyted password
- Artifactory
- Host: `<artifactory-hostname>`
- Codewind deployment registry: `<artifactory-hostname>/<username>`
- Address: `<artifactory-hostname>`
- Namespace: `<namespace>`
- Credentials: Artifactory user name and token
- OpenShift Registry
- Host: `docker-registry.default.svc:5000`
- Codewind deployment registry: `docker-registry.default.svc:5000/<project>`
- Address: `docker-registry.default.svc:5000`
- Namespace: `<project>`
- Credentials: OpenShift user name and token

## Step 1: Authenticating registry credentials
To push to the container registry, first add the registry credentials with Che.
1. On the Che dashboard, click the **Administration** tab in the sidebar.
2. Click **Add Registry**.
3. Enter the container registry host, such as `quay.io` or `http://index.docker.io/v1/`.
4. Enter your user credentials for the registry.
These credentials are passed into each Codewind workspace that is deployed in your user account in Che.
5. If a Codewind workspace is already running, restart the workspace to make the changes take effect.

## Step 2: Specifying the deployment registry for the Codewind workspace
Before you deploy your project with Codewind, first specify a deployment registry to push the images to.
1. When you first deploy a project in Codewind, Codewind prompts you to set a deployment registry.
- If Codewind detects the registry is unset, Codewind prompts before deploying a project.
2. Enter a path with which to push your container.
- **Important:** Before attempting this step, ensure that you have correctly entered the registry credentials in the Che dashboard in Step 1.
3. Codewind asks if you want to verify push permissions. If you select **yes**, Codewind pushes a small `hello-world` image to the registry to verify permissions.

### Instructions specific to IBM Cloud Private
- The internal Docker registry on IBM Cloud Private is **not** supported. Instead, you need to use either an external registry or a container registry that you installed yourself.
- If a registry that you installed is using self-signed certificates, the registry must be whitelisted in both Kubernetes and Docker on **all** nodes.
- The `docker.io`, `quay.io`, and `artifactory` container registry hosts have been tested with IBM Cloud Private.
**Note:** For Docker Hub, the `Namespace` value is likely to be your username.

### Specifying image registries for Codewind
There are three scenarios in Codewind where you need to specify what image registry to use:

1. If you run Codewind on a remote Kubernetes cluster (this includes Che) to develop an Appsody style project, and the image registry for the Appsody stack requires credentials, you need to configure Codewind to use the credentials for that specific image registry.
2. If you run Codewind locally to develop an Appsody style project, and the image registry for the Appsody stack requires credentials, you need to `docker login` to the registry from the command line before you create the Appsody project.
3. If you run Codewind on a remote Kubernetes cluster (this includes Che) to develop a Codewind style project, you need to configure Codewind with an image registry to push the application's image to that specific image registry.

If you do not develop any Codewind style projects,and you use an image registry that does not require credentials, then you do not need to specify an image registry.

### Instructions specific to OKD and OpenShift
To use the OpenShift internal Docker registry with Codewind, see [Using the OpenShift Internal Registry with Codewind](https://www.eclipse.org/codewind/openshiftregistry.html).