diff --git a/CustomDebianContainer.html b/CustomDebianContainer.html new file mode 100644 index 0000000..c01045b --- /dev/null +++ b/CustomDebianContainer.html @@ -0,0 +1,31 @@ + + + + Custom Debian container + + + +

Custom Debian container

+ +

Debian containers can be easily built using debootstrap to create a basic Debian chroot, which can then be cleaned up and tared to add to a Containerfile.

+

The following is the process:

+ +
sudo apt-get install debootstrap
+sudo mkdir -p /opt/mydebian/rootfs
+cd /opt/mydebian
+sudo debootstrap stable ./rootfs http://deb.debian.org/debian
+sudo rm -fr ./rootfs/debootstrap
+sudo rm -fr ./rootfs/var/cache/*
+sudo rm -fr ./rootfs/var/lib/apt/lists/*
+sudo tar czf rootfs.tar.gz -C ./rootfs .
+cat << __EOF__ | sudo tee Containerfile
+FROM scratch
+ADD rootfs.tar.gz
+CMD ["/bin/bash"]
+__EOF__
+podman build -t mydebian:latest .
+ +

This will create a podman image tagged mydebian:latest with the current stable packages.

+ + +