Containerization and Virtualization Concepts
Julia Ostheimer
Freelance AI Consultant
FROM
instructionFROM
COPY
RUN
ENTRYPOINT
Syntax:
FROM <name_of_image>
Example:
# Define the image on which to build
FROM python:3.10
Syntax:
COPY <source> <destination>
Example:
# Copy files/folders to the main folder of the container
COPY . .
Syntax:
RUN <command>
Example:
# Install the application's dependencies
RUN pip install -r requirements.txt
Syntax:
ENTRYPOINT ["command", "argument"]
Example:
# Run the script when the container starts
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"]
Syntax:
docker build <context>
Syntax:
docker run <name_of_image>
Containerization and Virtualization Concepts