Docker & Containerization Flashcards

1
Q

What is Docker, and how does it help in application development?

A

Docker is a platform that allows applications to run in isolated environments called containers. It simplifies the deployment of applications by ensuring they run the same regardless of the environment (dev, staging, production). Containers package the application and its dependencies, ensuring consistency across all stages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the difference between Dockerfile and Docker Compose?

A

Dockerfile: Used to create an image by specifying the build steps for a single application or service.
Docker Compose: A tool for defining and running multi-container Docker applications. It uses a docker-compose.yml file to define services, networks, and volumes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How would you troubleshoot a Docker container that’s not starting?

A

First, check the container logs using docker logs [container_id]. Then inspect the Dockerfile and image for configuration errors, and ensure that dependencies are correctly set up. You can also check container networking with docker inspect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What’s the difference between Docker and Kubernetes?

A

Docker is a container runtime for running individual containers, while Kubernetes is a container orchestration platform for managing, scaling, and deploying multiple containers across a cluster of machines.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you scale a Docker-based application?

A

You can scale applications using Docker Swarm or Kubernetes. For Docker Compose, you can scale a service with the docker-compose up –scale command. Kubernetes offers more robust, automated scaling mechanisms.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly