Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- fed_micro_build=$(buildah from --name builder registry.fedoraproject.org/fedora)
- buildah run $fed_micro_build -- mkdir -p /mnt/rootfs
- buildah run $fed_micro_build -- dnf install --installroot /mnt/rootfs coreutils-single glibc-minimal-langpack @httpd:2.4/common --releasever 34 --setopt install_weak_deps=false --nodocs -y
- buildah run $fed_micro_build -- dnf upgrade --installroot /mnt/rootfs
- buildah run $fed_micro_build -- dnf clean all
- buildah run $fed_micro_build -- rm -rf /mnt/rootfs/var/cache/*
- buildah run $fed_micro_build -- rm -rf /mnt/rootfs/var/log/dnf*
- buildah run $fed_micro_build -- rm -rf /mnt/rootfs/var/log/yum.*
- buildah run $fed_micro_build -- ls /var/cache
- buildah run $fed_micro_build -- du -sh /var/cache
- fed_micro=$(buildah from --name result scratch)
- buildah copy --from=$fed_micro_build $fed_micro /mnt/rootfs/ /
- buildah run $fed_micro -- ls /var/cache
- buildah config --label com.redhat.component="fedora-micro-httpd-container" --label name="f34/httpd-micro" --label version="34" --label summary="fedora 34 micro httpd image" --label io.k8s.display-name="httpd-micro" --label description="Very small image which doesn't install the package manager" $fed_micro
- buildah config --cmd '["/bin/bash"]' $fed_micro
- buildah commit --squash $fed_micro registry.fedoraproject.org/f34/httpd-micro
- buildah rm $fed_micro $fed_micro_build
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement