Concepts de conteneurisation et de virtualisation
Julia Ostheimer
Freelance AI Consultant







FROMFROM COPY RUNENTRYPOINTSyntaxe :
FROM <name_of_image>
Exemple :
# Définir l’image de base
FROM python:3.10
Syntaxe :
COPY <source> <destination>
Exemple :
# Copier fichiers/dossiers dans le dossier racine du conteneur
COPY . .
Syntaxe :
RUN <command>
Exemple :
# Installer les dépendances de l’application
RUN pip install -r requirements.txt
Syntaxe :
ENTRYPOINT ["command", "argument"]
Exemple :
# Lancer le script au démarrage du conteneur
ENTRYPOINT ["python", "hello_world.py"]
# Define the image on which to build
FROM python:3.10
# Define the image on which to build
FROM python:3.10
# Copy files/folders to the main folder of the container
COPY . .
# Define the image on which to build
FROM python:3.10
# Copy files/folders to the main folder of the container
COPY . .
# Install the application's dependencies
RUN pip install -r requirements.txt
# Define the image on which to build
FROM python:3.10
# Copy files/folders to the main folder of the container
COPY . .
# Install the application's dependencies
RUN pip install -r requirements.txt
# Run the script when the container starts
ENTRYPOINT ["python", "hello_world.py"]
Syntaxe :
docker build <context>
Syntaxe :
docker run <name_of_image>
Concepts de conteneurisation et de virtualisation