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:

  1. 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.
  2. Images: Templates used to create containers. Images contain the application code, dependencies, and configurations. Docker Hub is a popular registry for publicly available images.
  3. Docker Engine: The runtime environment that manages containers and images on a host machine.
  4. Volumes: Mechanisms for persisting data generated by containers, allowing data to be preserved even after a container is deleted.
  5. Networking: Docker provides various networking modes for containers to communicate with each other and the host machine.

How it works?

  1. 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.
  2. Image Push (Optional):
    • Developers can push their images to a registry like Docker Hub for sharing or later use.
  3. 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.
  4. Container Management:
    • Docker provides commands for managing containers (e.g., start, stop, rm) and accessing their logs and shells.