Linux Containers
⏱
9 mins remaining
Linux Images - From debs to images
What is inside a .deb ?
- Pick a .deb file from the APT cache
/var/cache/apt/archives. Copy somewhere safe. - Extract the .deb file
arand peak into its content usingtar.
ar -x *.deb
tar -tf control.tar.zst
tar -tf data.tar.zst
Control Archive (
control.tar.zst) This archive contains control files and scripts that manage the package installation, removal, and configuration. Key files include:- control: Contains metadata like package name, version, dependencies, and maintainer information.
- postinst, preinst, postrm, prerm: Scripts executed during various stages of package installation and removal.
Data Archive (
data.tar.zst): This archive contains the actual files to be installed on the system. It includes the directory structure and files that will be placed in their respective locations on the target system.Debian Binary Control File (
debian-binary): A text file indicating the Debian package format version. It typically contains the version number, such as “2.0” or “2.0\n”.
💡 What are the .deb limitations ?
Open Discussion: What do you think are .deb (native package management) limitations.
What is inside a container images ?
- Pick a container image from
docker imagesoutput - Save the image into a safe place using
docker save -o output.tar - extract the tar file and peak into its content
tar -xvf output.tar
tar -tf <layer1>.tar | less
tar -tf <layer2>.tar | less