Skip to content

Instantly share code, notes, and snippets.

@pichuang
Created March 7, 2021 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pichuang/896173544bd167b221f847dc01b3b4d6 to your computer and use it in GitHub Desktop.
Save pichuang/896173544bd167b221f847dc01b3b4d6 to your computer and use it in GitHub Desktop.
FROM registry.access.redhat.com/ubi8/ubi:8.3
RUN dnf -y install nginx && \
dnf -y clean all
FROM registry.access.redhat.com/ubi8/ubi:8.3 as build-env
RUN dnf -y --installroot /output \
--setopt=install_weak_deps=false --nodocs \
install glibc-minimal-langpack coreutils-single && \
dnf -y module install nginx && \
dnf -y --installroot /output clean all
FROM scratch
COPY --from=build-env /output /
$ podman pull registry.access.redhat.com/ubi8/ubi:8.3
$ buildah bud -t ubi83-with-dnf -f Dockerfile-with-dnf
$ buildah bud -t ubi83-without-dnf -f Dockerfile-without-dnf
$ podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/ubi83-without-dnf latest a139d79baad2 3 minutes ago 38.9 MB
localhost/ubi83-with-dnf latest afaf2766670f 20 minutes ago 272 MB
registry.access.redhat.com/ubi8/ubi 8.3 4199acc83c6a 3 weeks ago 213 MB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment