When comparing Docker vs DPKG (Debian Package Manager), the Slant community recommends DPKG (Debian Package Manager) for most people. In the question“What are the best Linux package managers?” DPKG (Debian Package Manager) is ranked 3rd while Docker is ranked 11th. The most important reason people chose DPKG (Debian Package Manager) is:
DKPG has one of the best multiarch support you can easily add new architectures with dpkg --add-architecture $ARCH to install foreign architectures.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Allows for portable application deployment
Docker creates a single object, containing an application with its dependencies, that can be moved between any docker-enabled machines, guaranteeing the same environment for application execution.
Pro Git-like capabilities
Docker tracks changes in systems. It allows for commits and rollbacks and for quick deployment due to having to deploy only the updated code.
Pro Allows re-using components
Docker essentially allows creating boilerplate systems (a LAMP stack, for example) that can be used as a starting point on multiple projects. And you can find multiple such containers already created by people in their public registry.
Pro Automatic build
Allows automatically assembling a container from its source code.
Pro Provides easy sharing and installation of containers through a public registry
Docker allows easily pushing and pulling containers to and from their public index.docker.io registry. Additionally, dotCloud maintains a list of official repositories of the more popular containers.
Pro Application-centric
Pro Works in virtualized environments
You can set up Docker within an already virtualized environment such as a virtual machine. This allows you to run Docker on Mac and Windows, among other use-cases.
Pro Low overhead
Pro Supports a wide range of isolation tools
Docker can be used with OpenVZ, systemd-nspawn, libvirt-lxc, libvirt-sandbox, qemu/kvm, BSD Jails, Solaris Zones, and chroot.
Pro Tool ecosystem
Pro Great multiarch support
DKPG has one of the best multiarch support you can easily add new architectures with dpkg --add-architecture $ARCH to install foreign architectures.
Pro Follows the UNIX philosophy
DPKG and it frontends follow strictly the UNIX philosophy that one package should do one thing well.
eg:
Dpkg: does simple package management
APT and aptitude : adds repository and dependency tracking
debconf: does configuration
synaptic: allows mouse interaction to all apt/aptitude options
Pro De facto package manager / widely used
Due the popularity of Ubuntu, Debian and Linux Mint it is almost certain that you find the package you want as a pre-built deb package.
Pro Fast
DPKG isn't as bloated as other package managers since it is only made for local package management.
Pro Plenty of frontends
You can use apt, aptitude, cupt, debdelta or apt-build on the terminal.
Pro Very easy to create packages
There are plenty of helpers to easily create packages.
You just need to create 5 files: source/format, compat, rules, control & changelog and run dpkg-buildpackage.
Pro User interaction
It is possible to interact/ask questions to all pre and post install scripts. This makes it possibe to add questions for package configuration or to display EULA/License screens that have to be accepted before installation.
Pro Standard archives
Deb packages are simple ar archives with additional tar, lzma, bzip, gzip support.
Pro You can create deb packages on almost all linux distributions
This makes maintenance and support easy.
Cons
Con Large image size
Con Security concerns
Con Kernel OS fragmentation
Con Does not work well with packagekit
Since packagekit was developed with rpm in mind it does not support all dpkg features.
Con Package creation needs more than one file
A debian package needs at least the following files to build it with debhelper
debian/source/format - deb format
debian/changelog - changelog file with version number and dae etc.
debian/compat - debian package version
debian/control - package information, dependencies & co
debian/copyright - license information
debian/rules - the make file to build the package
However the really important files are control, changelog and rules all other are generic.