OpenLiberty / OpenLiberty/ci.docker

yum fails via podman when using liberty ubi images

Open
#198 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
Shell
Stars
48
Forks
60
Avg merge
3h 2m
Merged PRs (30d)
3

Description

This is an odd one, if I extend a liberty ubi image (I've tried various, but for sure, openliberty/open-liberty:kernel-java8-openj9-ubi ) and try to use yum to install additional packages, it fails if the build is using podman.

RedHat installs podman instead of docker on rhel, and it's not too simple to put docker back instead.

If I code a simple Dockerfile that just extends adoptopenjdk/openjdk8-openj9:ubi and uses yum install, this works with both podman, and docker. Same if I extend the RH registry.access.redhat.com/ubi8/ubi image. There's something particular about the liberty images that's causing the failure.

I'd lean towards it being a podman bug, but @arthurdm suggested it get raised here first for an investigate to figure if liberty needs to raise this against podman.

Dockerfile

FROM openliberty/open-liberty:kernel-java8-openj9-ubi
USER root
RUN yum install iputils -y

Output

$> podman build .
STEP 1: FROM openliberty/open-liberty:kernel-java8-openj9-ubi
STEP 2: USER root
a90741eb0bd4399a7dbab9c2efcd490cbd8ea46bd7f85a55359c3e5f8879f5a7
STEP 3: RUN yum install iputils -y
Updating Subscription Management repositories.
Unable to read consumer identity
Subscription Manager is operating in container mode.
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Red Hat Universal Base Image 8 (RPMs) - BaseOS  3.8 MB/s | 766 kB     00:00    
Error: Cannot rename directory "/var/cache/dnf/ubi-8-baseos-53c30a88cff3796c/tmpdir.1LFk4E/repodata" to "/var/cache/dnf/ubi-8-baseos-53c30a88cff3796c/repodata": cannot create directory /var/cache/dnf/ubi-8-baseos-53c30a88cff3796c/repodata: File exists
Error: error building at STEP "RUN yum install iputils -y": error while running runtime: exit status 1

Workaround: adding RUN rm -rf /var/cache/dnf before the execution of yum install (a guess based on the error above) clears the issue, although that's probably not a great idea in the long run, it's enough to at least let me keep playing with the image.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the provided Dockerfile and podman build ., then compare it with the stated Docker and UBI image cases. Start with the yum install iputils -y step and the /var/cache/dnf workaround. Done means identifying whether the Liberty image or Podman causes the cache rename error and determining the appropriate fix or escalation.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, linux
Domain
devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.