How containers work as packages
Docker became standard tooling to package up software when the goal is to include a system that is known to be a working setup. A Docker container typically contains both the software you want to run as well as a whole, though frequently trimmed down, Linux system as its execution environment. This execution environment provides libraries and tools, as well as some other things, like basic system configuration, so that it can function as a standalone entity, independent of the system running the container. The primary goal is to make sure that the application can successfully be run on the developer’s machine, production and test environments, and elsewhere, without having to take care of details, such as the operating system versions, installed libraries.
It is important to keep in mind that the operating system and libraries don’t disappear. Bugs in libraries may still exist and any packaged dependencies should be updated for security...