Docker Introduction
- Docker Introduction
Docker Introduction
- Docker is an application container engine that packages an application with its dependencies into a portable container and can then run it on any popular Linux or Windows machine, achieving virtualization as well.
- Why do we have Docker? Developers and operators often run into the same problem: an application works perfectly in the developer’s environment but is riddled with bugs in production.
- A program’s execution spans several layers—from hardware architecture through the operating system down to the application itself—but developers usually focus only on the application, ignoring issues in the other layers.
- Docker was created to solve this problem: it bundles the application and all of its dependencies into a container so that you never have to worry about the underlying environment.
- By keeping development and production environments in sync, developers can build, test, and deploy applications locally without stressing over environmental differences. Development and operations become far more efficient at the modest cost of a tiny amount of extra resource usage.
I strongly urge every developer to learn how to use containers for development and deployment. For a relatively small cost, you can provide your applications with a stable runtime environment and thus improve both development and operations efficiency.
Here’s an everyday-language description of a typical Docker workflow:
- From scratch, create a development environment that includes the operating system, application, dependencies, configuration files, and so on.
- The environment can run anywhere and be reproduced anywhere.
- Compiling the source in this environment yields stable, predictable, and identical behavior every time.
- Running the program in this environment leaves no room for ambiguity.
- Ideally, describe the entire environment declaratively (e.g., with docker-compose) to eliminate hidden differences—everything about the environment is already specified in the declaration.
- Create a commit, build an image (a snapshot) that stores the current environment for later use.
- Share the image with other developers and operators so everyone works from the same baseline.
- As the product evolves, modify the image, commit again, rebuild, and redistribute the new image.
Basic Architecture of Docker
- [[Docker Networking]]