Docker OverView
Docker OverView
Docker OverView
2. Docker Overview
Dr Mouhim Sanaa
WHAT IS IN IT?
◾ MapReduce Introduction
◾ MapReduce Phases
◾ Word count exemples
◾ MapReduce java code
◾ how does Hadoop run MapReduce jobs
◾ Limitation of MapReduce V1
◾ YARN ARCHITECTURE
◾ YARN COMPONENTS
Docker Overview
• Docker provides the ability to package and run an application in a loosely isolated environment called a
container.
• These containers package an application and its dependencies, ensuring consistent behavior
across different environments.
Docker Architecture
Docker client
Docker Daemon
Docker Registry
Images
Docker images are created from Dockerfiles, which contain instructions for building an image layer by layer.
Containers
Containers are instances of images, providing an isolated environment for running applications
Exemple
In this example, we’ll create a Docker image that contains a simple Nginx web server. We’ll then run a container
using that image.
1. Create a file named Dockerfile (with no file extension) in a directory of your choice. This file
contains instructions for building the Docker image.
2. Create an index.html file in the same directory as the Dockerfile. This will be the content
displayed by the Nginx web server.
<!DOCTYPE html>
<html>
<head>
<title>Hello Docker!</title>
</head>
<body>
<h1>Hello, Docker!</h1>
<p>This is a simple Docker container running an Nginx web
server.</p>
</body>
</html>
Exemple
In this example, we’ll create a Docker image that contains a simple Nginx web server. We’ll then run a container
using that image.
3. Open a terminal, navigate to the directory containing the Dockerfile and index.html, and
run the following command to build the Docker image
4. Now that we have our Docker image, let’s run a container based on it. Run the
following command:
5. Open a web browser and navigate to http://localhost:8080. You should see the
contents of the index.html file displayed by the Nginx web server running inside the
Docker container.
docker rm <container_id_or_name>
Pushing and Pulling Docker Images to/from a Registry
• Docker images can be stored in public or private registries. Docker Hub is a popular public registry. Private
registries allow organizations to control image distribution and access.
• In this example, we’ll push the Nginx Docker image we created earlier to Docker Hub, a popular public Docker
registry.
3. Tag the Docker image with your Docker Hub username and a repository name:
Servic
api ….
es
Configuration
• You use a single YAML file to configure and maintain your application’s sevices
• With a single command, you create and start all the services from your configuration
version: "3.7"
services:
...
volumes:
...
networks:
...
Docker Compose
version: "3.7"
Configuration services:
...
volumes:
• services refer to the containers’ configuration. ...
networks:
services: ...
frontend:
image: my-vue-app
...
backend:
image: my-springboot-app
...
db:
image: postgres
...
Docker Compose
Configuration services:
my-service:
image: ubuntu:latest
• services refer to the containers’ configuration. ...
services:
services:
my-custom-app:
frontend:
build: /path/to/dockerfile/
image: my-vue-app
...
...
backend:
services:
image: my-springboot-app
my-custom-app:
...
build: https://github.com/my-company/my-
db:
project.git
image: postgres
image: my-project-image
...
...