Skip to content

Commit a931b87

Browse files
committed
Dockerfile: clear yum/dnf cache after installing packages
1 parent 13ec4b7 commit a931b87

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Dockerfile

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ARG RUNTIME_DEPS="ruby"
1313
RUN echo -e "[ruby]\nname=ruby\nstream=${RUBY_VERSION}\nprofiles=\nstate=enabled\n" > /etc/dnf/modules.d/ruby.module \
1414
&& microdnf update --nodocs \
1515
&& microdnf install --nodocs ${RUNTIME_DEPS} \
16+
&& rm -rf /var/cache/yum /var/cache/dnf \
1617
&& gem install -N bundler -v "= ${BUNDLER_VERSION}" \
1718
&& chown -R 1001:1001 "${HOME}"
1819

@@ -21,7 +22,8 @@ FROM base AS builder-base
2122

2223
ARG BUILD_DEPS="tar make file findutils git patch gcc automake autoconf libtool redhat-rpm-config openssl-devel ruby-devel"
2324

24-
RUN microdnf install --nodocs ${BUILD_DEPS}
25+
RUN microdnf install --nodocs ${BUILD_DEPS} \
26+
&& rm -rf /var/cache/yum /var/cache/dnf
2527

2628
COPY --chown=1001:1001 ./Gemfile* "${HOME}/app/"
2729

@@ -56,7 +58,8 @@ FROM builder-base AS dev
5658
USER root
5759

5860
ARG DEV_TOOLS="vim gdb"
59-
RUN microdnf install --nodocs ${DEV_TOOLS}
61+
RUN microdnf install --nodocs ${DEV_TOOLS} \
62+
&& rm -rf /var/cache/yum /var/cache/dnf
6063

6164
ARG DEV_UID=1001
6265
ARG DEV_GID=1001

0 commit comments

Comments
 (0)