A devfile refers to various resources, such as container images and starter projects. The current devfile registry currently does not store those supporting resources. Therefore, you must have access to those resources when using those devfiles.
To support the air gap installation of the devfile registry, the air gap scenario divides into two stages:
Build a devfile registry based on one or more source repositories so that the registry contains all the resources available for offline installation.
Install the devfile registry to a cluster to make it available for users to access the registry.
Stage 1: Build and Package a Devfile Registry
The main goal of this stage is:
Pull in resources into the registry as part of the registry build.
Modify the devfile to update references to those offline resources as part of the registry build.
Golang 1.17.x or higher
Docker 17.05 or higher or Podman 4.0.x or higher
Archive Tools (such as
Create Offline Registry
Download / clone the devfile/registry repository.
Clone through HTTPS
$ git clone https://github.com/devfile/registry.git /path/to/registry
Clone through SSH
$ git clone firstname.lastname@example.org:devfile/registry.git /path/to/registry
Install Stack Images
You will first need to collect all the image tags used in the stacks needed for offline access. The image tags collected are to each be pulled, re-tagged, and installed into the image repository accessible by the offline cluster. Procedure here will require you to change the devfile.
docker pullor the
podman pullto pull down an image for a stack component:
$ podman pull registry.access.redhat.com/ubi8/nodejs-16:latest
docker tagor the
podman tagto re-tag the image that uses the form
$ podman tag registry.access.redhat.com/ubi8/nodejs-16:latest \ <registry_host>:<port>/<project>/nodejs-16:latest
podman pushto push the re-tagged image to the image repository at
$ podman push <registry_host>:<port>/<project>/nodejs-16:latest
Packaging Starter Projects
To package starter projects you will need to download them manually then place them under
/stacks/<stack>/<zip>-offline.zip. Procedure here will require you to change the devfile.
Starter projects must be packaged under an archive with the suffix
-offline to be pulled into the registry.
zip- Download archive
$ cd /path/to/registry $ curl -L https://code.quarkus.io/d?e=io.quarkus%3Aquarkus-resteasy&e=io.quarkus%3Aquarkus-micrometer&e=io.quarkus%3Aquarkus-smallrye-health&e=io.quarkus%3Aquarkus-openshift&cn=devfile \ -o stacks/java-quarkus/community-offline.zip
git- Package cloned contents into a directory then archive
$ cd /path/to/registry $ git clone https://github.com/odo-devfiles/nodejs-ex.git \ stacks/nodejs/nodejs-starter-offline $ cd stacks/nodejs $ zip -r nodejs-starter-offline.zip nodejs-starter-offline
Change the devfile so you can update references to those offline resources as part of the registry build. For all the items pulled into the registry, update the corresponding devfile entries to reference the resources within the offline version in the registry:
All location references to
starterProjectswill change to local paths relative to the stacks directory.
Stack component image references will change to use the offline accessible image repository.
starterProjects, find the starter project definition you want to make offline.
Under the definition for the starter project find either
Before: Starter Projectdevfile.yaml
starterProjects: - name: nodejs-starter git: remotes: origin: https://github.com/odo-devfiles/nodejs-ex.git
Do one of the following depending on the block type:
git, replace all of the
gitblock with a
zipblock and add the
locationto be the path to the local file under the stack root directory (
zip, replace the value of
locationto the local file under the stack root directory (
To confirm you modified your devfile, verify your altered starter project definition is similar to the following example:
After: Starter Project
starterProjects: - name: nodejs-starter zip: location: nodejs-starter-offline.zip
If not already at the root of the registry, change to the root of the registry.
$ cd /path/to/registry
Build the registry image.
$ bash .ci/build.sh
To create your own registry Git repository, see Building a custom devfile registry
For more on interacting with the OpenShift Image Registry, see Accessing the registry
To learn more about starter projects in devfiles, see Adding projects to a devfile
For more information about building your own registry image, see Building a custom devfile registry
Stage 2: Install a Devfile Registry to a cluster
In this stage, you will push the container images to a registry available to the offline cluster.
- Docker 17.05 or higher or Podman 4.0.x or higher
Install Image into Cluster Image Registry
The process of installing the built images into an offline image registry depends on which image registry has deployed and which image registry you have access to.
docker tagor the
podman tagto re-tag the image using the form
$ podman tag devfile-index <registry_host>:<port>/<project>/devfile-index
podman pushto push the re-tagged image to the cluster image registry at
$ podman push <registry_host>:<port>/<project>/devfile-index
- For more on interacting with the OpenShift Image Registry, see Accessing the registry
Update strategy for refreshing registry contents
Steps to update an already deployed registry in the air gap scenario:
Follow offline registry instructions in the above sections and rerun the registry build script to rebuild the devfile registry.
Update the existing offline devfile registry deployment with a newly built and updated offline devfile registry image.