Advertisement
mroche

Fedora HTTPD micro

Sep 8th, 2021
1,734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.35 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. fed_micro_build=$(buildah from --name builder registry.fedoraproject.org/fedora)
  4. buildah run $fed_micro_build -- mkdir -p /mnt/rootfs
  5. 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
  6. buildah run $fed_micro_build -- dnf upgrade --installroot /mnt/rootfs
  7. buildah run $fed_micro_build -- dnf clean all
  8. buildah run $fed_micro_build -- rm -rf /mnt/rootfs/var/cache/*
  9. buildah run $fed_micro_build -- rm -rf /mnt/rootfs/var/log/dnf*
  10. buildah run $fed_micro_build -- rm -rf /mnt/rootfs/var/log/yum.*
  11. buildah run $fed_micro_build -- ls /var/cache
  12. buildah run $fed_micro_build -- du -sh /var/cache
  13.  
  14. fed_micro=$(buildah from --name result scratch)
  15. buildah copy --from=$fed_micro_build $fed_micro /mnt/rootfs/ /
  16. buildah run $fed_micro -- ls /var/cache
  17. 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
  18. buildah config --cmd '["/bin/bash"]' $fed_micro
  19. buildah commit --squash $fed_micro registry.fedoraproject.org/f34/httpd-micro
  20. buildah rm $fed_micro $fed_micro_build
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement