Docker
Used at Ford too. Basically essential skill to have or just to have used it.
Docker is a containerization platform that allows developers to package, ship, and run applications in containers. Containers are lightweight and portable, providing a consistent and reliable way to deploy applications across different environments, such as development, testing, staging, and production.
What actually happens
If you run more than one container, you can let your containers communicate with each other by attaching them to the same network. Docker creates virtual networks which let your containers talk to each other. In a network, a container has an IP address (of course) and optionally a hostname.
Key Concepts:
- Containers: Isolated, self-contained execution environments for applications. Containers run as a process on the host operating system, sharing the same kernel but with their own isolated user space.
- Images: Templates used to create containers. Images contain the application code, dependencies, and configurations. Docker Hub is a popular registry for publicly available images.
- Docker Engine: The runtime environment that manages containers and images on a host machine.
- Volumes: Mechanisms for persisting data generated by containers, allowing data to be preserved even after a container is deleted.
- Networking: Docker provides various networking modes for containers to communicate with each other and the host machine.
How it works?
- Image Creation:
- A developer creates a Dockerfile, which defines the build process for the image.
- The Dockerfile specifies the base image, copies application code, installs dependencies, and sets configurations.
- Running
docker build
generates the Docker image.
- Image Push (Optional):
- Developers can push their images to a registry like Docker Hub for sharing or later use.
- Container Creation:
- Users run
docker run
with the desired image, and Docker creates a new container from the image. - The container starts as a process on the host machine, executing the application.
- Users run
- Container Management:
- Docker provides commands for managing containers (e.g.,
start
,stop
,rm
) and accessing their logs and shells.
- Docker provides commands for managing containers (e.g.,