Docker-Bundle Flashcards
What is Docker?
Docker is an open-source platform for developing, shipping, and running applications inside lightweight, portable containers.
What are Docker containers?
Docker containers are isolated environments created using Docker, where applications can run with their dependencies.
How does Docker differ from virtual machines?
Docker containers share the host system’s kernel, are more lightweight, and start faster compared to virtual machines that have full-blown operating systems.
What is a Docker image?
A Docker image is a lightweight, standalone, executable package that includes everything needed to run a piece of software, including the code, runtime, libraries, environment variables, and config files.
What is a Dockerfile?
A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image.
How do you create a Docker container?
By using the docker run command along with various options and an image name.
What is Docker Hub?
Docker Hub is a cloud-based registry service that allows you to link to code repositories, build your images, test them, store manually pushed images, and link to Docker Cloud.
How do you stop a Docker container?
Use docker stop <container_id> to gracefully stop a container. You can also use docker kill <container_id> for a forceful stop.</container_id></container_id>
Explain the role of the docker ps command.
The docker ps command is used to list the running containers.
How do you list all Docker containers?
Use docker ps -a to list all containers, including the ones that are stopped.
What are Docker network drivers?
Network drivers provide the networking capabilities for containers. Common types include bridge, host, overlay, macvlan, and none.
Explain Docker bridge network.
The default network driver for Docker. When you run a container with the docker run command, it automatically connects to this network.
How do you create a Docker network?
Use docker network create followed by options and the network name.
Can Docker containers communicate with each other by default?
Containers on the same network can communicate with each other. Containers on different networks need explicit port mapping.
What is port mapping in Docker?
Port mapping is the process of mapping a port on the host to a port in the container to allow external access to the container.
What are Docker volumes?
Docker volumes are the preferred way of handling persistent data created by and used by Docker containers.