Product Docs
-
-
-
-
-
-
-
- Install chainctl
- Get Started with chainctl
- chainctl vs Console
- Manage Your chainctl Configuration
- Find and Update Your chainctl Release Version
- Compare Images with chainctl
- Create, View, and Delete chainctl Events
- Manage Identity and Access with chainctl
- Manage Chainguard Container Images with chainctl
-
- chainctl
- chainctl auth
- chainctl auth configure-docker
- chainctl auth login
- chainctl auth logout
- chainctl auth pull-token
- chainctl auth status
- chainctl auth token
- chainctl config
- chainctl config edit
- chainctl config reset
- chainctl config save
- chainctl config set
- chainctl config unset
- chainctl config validate
- chainctl config view
- chainctl events
- chainctl events subscriptions
- chainctl events subscriptions create
- chainctl events subscriptions delete
- chainctl events subscriptions list
- chainctl iam
- chainctl iam account-associations
- chainctl iam account-associations check
- chainctl iam account-associations check aws
- chainctl iam account-associations check gcp
- chainctl iam account-associations describe
- chainctl iam account-associations set
- chainctl iam account-associations set aws
- chainctl iam account-associations set gcp
- chainctl iam account-associations unset
- chainctl iam account-associations unset aws
- chainctl iam account-associations unset gcp
- chainctl iam folders
- chainctl iam folders delete
- chainctl iam folders describe
- chainctl iam folders list
- chainctl iam folders update
- chainctl iam identities
- chainctl iam identities create
- chainctl iam identities create github
- chainctl iam identities create gitlab
- chainctl iam identities delete
- chainctl iam identities describe
- chainctl iam identities list
- chainctl iam identities update
- chainctl iam identity-providers
- chainctl iam identity-providers create
- chainctl iam identity-providers delete
- chainctl iam identity-providers list
- chainctl iam identity-providers update
- chainctl iam invites
- chainctl iam invites create
- chainctl iam invites delete
- chainctl iam invites list
- chainctl iam organizations
- chainctl iam organizations delete
- chainctl iam organizations describe
- chainctl iam organizations list
- chainctl iam role-bindings
- chainctl iam role-bindings create
- chainctl iam role-bindings delete
- chainctl iam role-bindings list
- chainctl iam role-bindings update
- chainctl iam roles
- chainctl iam roles capabilities
- chainctl iam roles capabilities list
- chainctl iam roles create
- chainctl iam roles delete
- chainctl iam roles list
- chainctl iam roles update
- chainctl images
- chainctl images diff
- chainctl images history
- chainctl images list
- chainctl images repos
- chainctl images repos build
- chainctl images repos build apply
- chainctl images repos build edit
- chainctl images repos build list
- chainctl images repos build logs
- chainctl images repos list
- chainctl libraries
- chainctl libraries entitlements
- chainctl libraries entitlements list
- chainctl packages
- chainctl packages versions
- chainctl packages versions list
- chainctl update
- chainctl version
Open Source
Education
How to Use Chainguard Containers with OpenShift
In this guide, you’ll find general instructions for how to get started using Chainguard Containers on Red Hat OpenShift Container Platform.
Red Hat OpenShift is an application platform that orchestrates and manages your systems and resources. While it is based on open source software like Kubernetes, OpenShift includes a suite of applications with additional functionality that are configured to work together.
Adding Chainguard Containers to your OpenShift deployment saves you the effort of CVE remediation and speeds up your security and compliance efforts.
When Using Chainguard Containers with OpenShift, there are some adjustments that need to be made to the usual process. This guide provides guidance. See the OpenShift docs for more details.
Adjust Ownership and Permissions
By default, OpenShift Container Platform runs containers using an arbitrarily assigned User ID (UID), as described in the Red Hat documentation.
There are required access settings for an image to support running as an arbitrary user:
- Directories and files that are written to by processes in the image must be owned by the
rootgroup and that group must have bothreadandwritepermissions - Files that will be executed must also have group execute permissions
Following the Red Hat requirements, to use Chainguard Containers you must make a change in your Dockerfile to set the required ownership and permissions. For example, if you have one or more files that you need to execute stored in /some/directory, then you would do this:
RUN chgrp -R 0 /some/directory && \
chmod -R g=u /some/directory
Create /app Directory and HOME
When running on OpenShift clusters, you will find that the OpenShift user cannot create config files inside their home directory. This is because OpenShift is designed to start container instances using a random User ID.
To avoid this being an issue when using Chainguard Containers:
- Set a
HOMEvariable for the user (it would otherwise be set as/for root) - Create an
/appdirectory in every Dockerfile - Set
/appdirectory permissions to755and ownership to65532:0
This can help you avoid or limit switching to the root user during the build phase when no package installation is required.
Here’s a sample Dockerfile covering this process.
# Change this to reference the image you want to pull and
# if needed, to use the location of your custom image repo
FROM cgr.dev/$ORGANIZATION/aspnet-runtime-db:9
USER 0
RUN mkdir -m 775 /app && chown -R 65532:0 /app
COPY --chown=65532:0 src/Sample.Service/bin/Release/net9.0/publish /app
USER 65532
WORKDIR /app
ENV HOME=/app
ENTRYPOINT ["dotnet", "Sample.Service.dll"]
Use Special Container Images for Hard-coded User IDs
There are cases where Red Hat hard codes UIDs for specific applications, for example, the user for Postgres is set to UID 26. See the Red Hat documentation for more details.
In this instance, Chainguard has built a special image for Postgres on OpenShift with a different release tag. Where the Postgres release version is 17.5 and the regular Chainguard Container would be released with the tag 17.5, there is another image released with the tag 17.5-openshift.
Understand Security Context Constraints (SCCs)
OpenShift Container Platform includes security context constraints (SCCs) that you can use to control permissions for the pods in your cluster. SCCs determine the actions that a pod can perform and what resources it can access.
SCCs in OpenShift will by default prevent a root user from running with the Chainguard Containers -dev variants.
Last updated: 2025-06-17 08:49
