Create an image pull Secret with oc

Create an image pull Secret with oc to allow Dev Workspace Pods to access container registries that require authentication.

Before you begin

Procedure

  1. In your user project, create an image pull Secret with your private container registry details and credentials:
    $ oc create secret docker-registry <Secret_name> \
        --docker-server=<registry_server> \
        --docker-username=<username> \
        --docker-password=<password> \
        --docker-email=<email_address>
  2. Add the required labels to the image pull Secret:
    $ oc label secret <Secret_name> controller.devfile.io/devworkspace_pullsecret=true controller.devfile.io/watch-secret=true

Results

  • Verify the Secret exists and has the required labels:
    $ oc get secret <Secret_name> --show-labels