docker-copy-3135ce60d0

Source: https://docs.docker.com/get-started/

container402x

  • Docker is a platform for developers and sysadmins to develop, deploy, and run applications with containers.
  • Containerization is increasingly popular because containers are:
    • Flexible: Even the most complex applications can be containerized.
    • Lightweight: Containers leverage and share the host kernel.
    • Interchangeable: You can deploy updates and upgrades on-the-fly.
    • Portable: You can build locally, deploy to the cloud, and run anywhere.
    • Scalable: You can increase and automatically distribute container replicas.
    • Stackable: You can stack services vertically and on-the-fly.
  • An image is an executable package that includes everything needed to run an application–the code, a runtime, libraries, environment variables, and configuration files.
  • container is a runtime instance of an image.
  • The hierarchy of a distributed application (top-to-bottom)
    • stack
    • services
    • container
  • Container
    • Define a container with Dockerfile
    • Dockerfile defines what goes on in the environment inside your container.
    • docker build
    • docker run
    • docker push
  • Services
    • Services are really just “containers in production.”
    • A service only runs one image, but it codifies the way that image runs—what ports it should use, how many replicas of the container should run so the service has the capacity it needs, and so on.
    • docker-compose.yml
    • You can scale the app by changing the replicas value in docker-compose.yml
  • Swarms
    • Multi-container, multi-machine applications are made possible by joining multiple machines into a “Dockerized” cluster called a swarm.
    • Swarm managers are the only machines in a swarm that can execute your commands, or authorize other machines to join the swarm as workers.
    • Workers are just there to provide capacity and do not have the authority to tell any other machine what it can and cannot do.
  • Stacks
    • A stack is a group of interrelated services that share dependencies, and can be orchestrated and scaled together.
  • Deploy your app
    • Connect Docker Cloud with your preferred provider, granting Docker Cloud permission to automatically provision and “Dockerize” VMs for you.
    • Use Docker Cloud to create your computing resources and create your swarm.
    • Deploy your app.

Leave a comment