IBM Cloud Code Engine (serverless) Application setup with a private registry — Step by Step Guide

Alain Airom (Ayrom)
4 min readFeb 29, 2024

The aim of the use case presented here is to provide a simplified step-by-step guide to deploy applications (any kind of application type eg. Batch, Job or Applications) from a private code repository (example here is using a private GitHub repo) to a private container image registry hosted on IBM Cloud.

This document assumes working with a private GitHub repository.

Create a Private Container Image Registry on IBM Cloud

The documentation:

Install, Set Up, and Log In

Podman with Docker compatibility could be used as well

Podman Desktop can replace Docker desktop with a 100% compatibility mode

  • Install the Container Registry plug-in (assuming IBM Cloud CLI is already installed)
ibmcloud plugin install container-registry -r 'IBM Cloud'
  • Log in to your IBM Cloud account
ibmcloud login -a

If you have a federated ID, use ibmcloud login — sso to log in to the IBM Cloud CLI.

ibmcloud login - sso
  • Ensure that you’re targeting the correct IBM Cloud Container Registry region. Hereafter the region is set to Frankfurt
ibmcloud cr region-set eu-central
The region is set to 'eu-central', the registry is ''.
  • Choose a name for your first namespace, and create that namespace. Use this namespace for the rest of the Quick Start.
ibmcloud cr namespace-add <my_namespace>
ibmcloud cr namespace-add xxx_namespace
Adding namespace 'xxx_namespace' in resource group 'default' for account XYZ's Account in registry

Push the image to your private registry (Testing the working with your registry)

  • Log your local Docker daemon into the IBM Cloud Container Registry.
ibmcloud cr login
  • Pull a test image from Docker Hub
docker pull hello-world
Using default tag: latest
c1ec31eb5944: Download complete
d2c94e258dcb: Download complete
  • Choose a repository and tag by which you can identify the image. Use the same repository and tag for the rest of this Quick Start
docker tag hello-world
  • Push the image
docker push
docker push
The push refers to repository []
1: digest: sha256:5c2d1c82f9ecc3c3f3b3a4a50f6db9d09cdddb301f3eff37ff2116aa3a65ae10 size: 861
  • Verify that your image is in your private registry
ibmcloud cr image-list
Listing images...

Repository Tag Digest Namespace Created Size Security status 1 5c2d1c82f9ec xxx_namespace 10 months ago 2.5 kB -

Create a Project in Code Engine

IBM Cloud Left side menu
Code Engine menu
  • Select Projects in the left side menu, select the Location and Resource group, optionally set Tags and hit the Create button
Create projet screen
  • Once the project is created, enter the project

Create an application from a private GitHub repository

  • Inside the Project click on Application on left side menu
  • In the application creation settings dialog box, set the values and hit the Specily build details button

The URL of a private repository is not HTTPS but GIT! The documentation could be found at:

Create Application screen #1
  • Specify the details as in the example below

The Code repo URL (private repo name provided in the previous step)

The Code repo access (How to create a SSH Key for yoru GitHub account) (or a good article on how to set-up a SSH Key for GitHub:

  • Hit Next
Create Application screen #2
  • Specify the build details and hit Next
Create Application screen #3
  • You see the Registry server. You can either let Code Engine generate a secret for the registry or build your own secret (refer to IAM documentation on IBM Cloud). Choose the right Namespace for your application deployment and you can let Code Engine manage the Repository (image name). Hit the Done button to start building your application.
Create Application screen #4

Once your application is deployed and running you can access it through the interface! You’re done, congrats!!!

Up and running serverless app dashboard

Links and helpers



Alain Airom (Ayrom)

IT guy for a long time, looking for technical challenges everyday!