Answers: <p>The Keycloak image <code>quay.io/keycloak/keycloak:21.1.1</code> is currently <a href="https://github.com/keycloak/keycloak/blob/main/quarkus/container/Dockerfile" rel="nofollow noreferrer">based on</a> the Red Hat Universal Base Image <code>ubi9-micro</code>, which lacks any package manager (<code>dnf</code>, <code>rpm</code>, <code>yum</code>) in order to minimize size.</p>
  <p>I came across a couple of tricks for installing packages regardless, e.g. <a href="https://www.redhat.com/en/blog/introduction-ubi-micro" rel="nofollow noreferrer">one</a> involving <code>buildah mount</code> and <a href="https://github.com/fatherlinux/ubi-micro/blob/master/ubi8-micro-openssl" rel="nofollow noreferrer">another one</a> involving multi-stage build plus <code>yum install --installroot /mnt/rootfs</code>. The second now serves well in my scenario.</p>
  
Answers: CC BY-SA 4.0
Answers: 2023-05-09T04:50:55.947Z
Answers: 2023-05-09T04:50:55.947Z
Answers: rookie099
Body: <p>I have a container (running image <code>quay.io/keycloak/keycloak:21.1.1</code>) where <code>cat /etc/os-release</code> reports the following (excerpt):</p>
  <pre><code>NAME=&quot;Red Hat Enterprise Linux&quot;
  VERSION=&quot;9.1 (Plow)&quot;
  CPE_NAME=&quot;cpe:/o:redhat:enterprise_linux:9::baseos&quot;
  </code></pre>
  <p><code>openssl</code> is not installed, neither is <code>yum</code>. (<code>yum install openssl</code> fails with &quot;command not found&quot;.) So how can I install OpenSSL into such an image (perhaps it is a <a href="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/building_running_and_managing_containers/index#con_understanding-the-ubi-micro-images_assembly_types-of-container-images" rel="nofollow noreferrer">UBI micro-image</a>)?</p>
  
Tags: <docker><oci>
Title: Install OpenSSL into Red Hat image lacking yum
UserDisplayName: rookie099
ThreadText: # Install OpenSSL into Red Hat image lacking yum
  
  (Asked by: username_0 on 2023-05-08)
  
  I have a container (running image `quay.io/keycloak/keycloak:21.1.1`) where `cat /etc/os-release` reports the following (excerpt):
  
  ```
  NAME="Red Hat Enterprise Linux"
  VERSION="9.1 (Plow)"
  CPE_NAME="cpe:/o:redhat:enterprise_linux:9::baseos"
  
  ```
  
  `openssl` is not installed, neither is `yum`. (`yum install openssl` fails with "command not found".) So how can I install OpenSSL into such an image (perhaps it is a [UBI micro-image](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/building_running_and_managing_containers/index#con_understanding-the-ubi-micro-images_assembly_types-of-container-images))?
  
  **Tags:** docker, oci
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2023-05-09. Score: 0
  
  The Keycloak image `quay.io/keycloak/keycloak:21.1.1` is currently [based on](https://github.com/keycloak/keycloak/blob/main/quarkus/container/Dockerfile) the Red Hat Universal Base Image `ubi9-micro`, which lacks any package manager (`dnf`, `rpm`, `yum`) in order to minimize size.
  
  I came across a couple of tricks for installing packages regardless, e.g. [one](https://www.redhat.com/en/blog/introduction-ubi-micro) involving `buildah mount` and [another one](https://github.com/fatherlinux/ubi-micro/blob/master/ubi8-micro-openssl) involving multi-stage build plus `yum install --installroot /mnt/rootfs`. The second now serves well in my scenario.
  
  
  ---
  
  