Docker
Docker packs a program and everything it needs into one sealed bundle, so it runs the same on a developer's laptop as it does on the live server.
Also known as containers containerisation container platform
Definition
Docker packs a program together with everything it needs to run. The code, the settings and the small tools underneath it all go into one sealed bundle, which is called a container. You build that bundle once, and it then behaves the same on a developer's laptop, on the test server and on the live server.
Before containers, "it works on my machine" was the most expensive sentence in software. A program ran fine for the person who wrote it and then broke on the server, because one small piece underneath was a different version. A container ends that argument by carrying its own copies of everything, so nothing is left on the server to disagree with.
A container is not a small computer, because it borrows the operating system of the machine it sits on. That is why it starts in about a second, while a full virtual machine takes a minute. One ordinary server can therefore hold many containers side by side, each one walled off from the rest. That wall earns its keep, because if one part of a system is broken into, the intruder does not get the others for free.
Two things catch people out, and the first is that a container forgets. When it restarts it comes back exactly as it was built, so anything written inside it, such as uploaded invoices or customer photos, has gone. Files and databases therefore have to be kept outside the container on purpose. The second is age, because every container sits on top of a base image somebody else wrote, and an image you downloaded a year ago carries every hole found in it since. Rebuilding on a fresh base is ordinary system security work rather than an extra, which is why Linkysoft rebuilds those images on a fixed schedule for the systems it looks after.
The real gain is freedom of movement, because a container carries its own world with it. Changing hosting company becomes a decision rather than a project, which is why Linkysoft builds every web application this way. The version we tested is then the exact one that goes live, not a rebuild of it. A client can therefore start on a small server at Hostrena and move to a bigger one without touching the code. Before you sign with any supplier, ask one question. When the container is thrown away and replaced, where does our data live? If the answer is vague, that is the answer.
Questions about Docker
Is Docker the same as a virtual machine?
Do I lose my data when a container restarts?
Does Docker make my system safer?
Does a small business need Docker?
Still not sure how this applies to your project?
Tell us what you are building and we will answer in plain language.