Skip to content

Commit

Permalink
fix ubi8 docker image creation by skipping yum clean metadata (#12902) (
Browse files Browse the repository at this point in the history
#12904)

ubi8 image uses microdnf as a package manager, and microdnf does
not support the "yum clean metadata" command. This commit adds
the logic to skip this command if the image_flavor is ubi8

(cherry picked from commit d1b12de)
  • Loading branch information
jsvd authored May 12, 2021
1 parent aee3946 commit be6024e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docker/templates/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,16 @@ RUN for iter in {1..10}; do {{ package_manager }} install -y http://mirror.cento
RUN for iter in {1..10}; do {{ package_manager }} update -y && \
{{ package_manager }} install -y procps findutils tar gzip which shadow-utils && \
{{ package_manager }} clean all && \
{% if image_flavor != 'ubi8' -%}
{{ package_manager }} clean metadata && \
{% endif -%}
exit_code=0 && break || exit_code=$? && \
echo "packaging error: retry $iter in 10s" && \
{{ package_manager }} clean all && \
{{ package_manager }} clean metadata && sleep 10; done; \
{% if image_flavor != 'ubi8' -%}
{{ package_manager }} clean metadata && \
{% endif -%}
sleep 10; done; \
(exit $exit_code)

# Provide a non-root user to run the process.
Expand Down

0 comments on commit be6024e

Please sign in to comment.