Created
March 7, 2021 09:18
-
-
Save pichuang/896173544bd167b221f847dc01b3b4d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM registry.access.redhat.com/ubi8/ubi:8.3 | |
RUN dnf -y install nginx && \ | |
dnf -y clean all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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