toolbox/images/fedora/f36/Containerfile
Debarshi Ray ff1212e103 images: Ensure that the desired manuals are indeed present
Building an OCI image leads to so much spew that it's hard to notice if
something unexpected happened, and as seen in the previous commit [1],
unexpected things do happen.

Therefore, this adds a built-in test to ensure that the desired files
are actually present in the final image.  Right now it only checks the
presence of some representative manuals to ensure that the packages
listed in the 'missing-docs' file really do get reinstalled, and the
documentation that was stripped out in the base image really does get
restored.

Only the images for currently maintained Fedoras (ie., 36, 37 and 38)
were updated.

[1] Commit 1fc50176c9
    https://github.com/containers/toolbox/pull/1226

https://github.com/containers/toolbox/pull/1226
2023-02-01 19:21:59 +01:00

43 lines
1.1 KiB
Docker

FROM registry.fedoraproject.org/fedora:36
ENV NAME=fedora-toolbox VERSION=36
LABEL com.github.containers.toolbox="true" \
com.redhat.component="$NAME" \
name="$NAME" \
version="$VERSION" \
usage="This image is meant to be used with the toolbox command" \
summary="Base image for creating Fedora toolbox containers" \
maintainer="Debarshi Ray <rishi@fedoraproject.org>"
COPY README.md /
RUN rm /etc/rpm/macros.image-language-conf
RUN sed -i '/tsflags=nodocs/d' /etc/dnf/dnf.conf
RUN dnf -y upgrade
RUN dnf -y swap coreutils-single coreutils-full
RUN dnf -y swap glibc-minimal-langpack glibc-all-langpacks
COPY missing-docs /
RUN dnf -y reinstall $(<missing-docs)
RUN rm /missing-docs
COPY extra-packages /
RUN dnf -y install $(<extra-packages)
RUN rm /extra-packages
COPY ensure-files /
RUN ret_val=0; \
while read file; do \
if ! compgen -G "$file" >/dev/null; then \
echo "$file: No such file or directory" >&2; \
ret_val=1; \
break; \
fi; \
done <ensure-files; \
if [ "$ret_val" -ne 0 ]; then \
false; \
fi
RUN rm /ensure-files
RUN dnf clean all