What problem does Docker solve?
Options
- 'It works on my machine' problems: the app runs the same everywhere (Correct option)
- It makes the code compile faster on every machine of the team
- It replaces the database with a lighter embedded one
- It writes the tests of the application for the developers
Answer
'It works on my machine' problems: it packages an app with everything it needs, so it runs the same everywhere
Why
Without Docker, an app depends on what is installed on each computer (Java version, libraries, settings). Differences cause errors.
Docker packages the app and its dependencies into an image; running that image gives a container that behaves the same on your laptop, on a colleague's computer and on a server.
Containers are lighter than virtual machines because they share the host's operating system kernel.
Remember
Docker = package once, run the same everywhere.