Docker Gamify Flashcards
What is Docker?
Docker is an open-source platform used to automate the deployment, scaling, and management of applications inside lightweight, portable containers.
Think of a docker ship carrying containers (the applications). The ship is the Docker engine, and the containers are isolated environments for your apps.
What is a Docker container?
A Docker container is a lightweight, portable, and self-sufficient unit that packages an application and its dependencies, ensuring consistency across multiple environments.
Imagine a container as a box that holds everything an application needs to run, wherever you deploy it.
What is a Docker image?
A Docker image is a read-only template used to create containers. It contains the application code, libraries, environment variables, and configuration files needed for running the app.
Think of an image as the blueprint from which containers are created.
What is Docker Hub?
Docker Hub is a cloud-based registry where Docker images are stored and shared. It contains both official and community-contributed images.
Consider Docker Hub as the library where you can find images to use or share.
What is a Dockerfile?
A Dockerfile is a text file that contains a series of commands and instructions to build a Docker image.
Think of a Dockerfile as a recipe for building a Docker image.
What is the purpose of docker run?
docker run is used to create and start a new container from a specified image.
Visualize it as running a command to launch a new container with all the necessary components inside.
What is Docker Compose?
Docker Compose is a tool for defining and running multi-container Docker applications using a YAML file for configuration.
Imagine Docker Compose as an orchestrator that coordinates multiple containers working together.
What is the difference between a Docker container and a virtual machine (VM)?
Docker containers share the host OS kernel and are lightweight, while VMs run their own OS and require more resources.
Think of a container as a tenant using shared space (host OS), while a VM is like a separate house with its own resources.
What is a Docker volume?
A Docker volume is a persistent storage mechanism used by containers to store data outside the container’s filesystem, ensuring data persists even after a container is removed.
Imagine a volume as a storage unit where you keep data that needs to outlast the container.
How do you check the running containers in Docker?
Use the command docker ps to list running containers.
Think of ps as ‘present status’ of the containers currently running.
What is the Docker network?
A Docker network allows containers to communicate with each other and with the host system. Docker supports different types of networks such as bridge, host, and overlay.
Visualize Docker networks as roads connecting your containers to each other and to the outside world.
What is the command to build a Docker image?
Use docker build -t <image-name> <path> to create an image from a Dockerfile.</path></image-name>
Think of docker build as construction – you’re building an image from the blueprint (Dockerfile).
What is the purpose of the docker exec command?
docker exec is used to run commands inside a running container.
Imagine this as opening the container to execute commands inside it while it’s still running.
What is the command to stop a Docker container?
Use docker stop <container-name> to stop a running container.</container-name>
Think of stop as turning off a machine, and the container is the machine that you control.
What is Docker Swarm?
Docker Swarm is Docker’s native clustering and orchestration tool for managing a cluster of Docker nodes and containers.
Picture Docker Swarm as a team leader managing a group of Docker containers across multiple machines.