Контейнеризация и виртуализация: основные концепции
Julia Ostheimer
Freelance AI Consultant







FROMFROMCOPYRUNENTRYPOINTСинтаксис:
FROM <name_of_image>
Пример:
# Define the image on which to build
FROM python:3.10
Синтаксис:
COPY <source> <destination>
Пример:
# Copy files/folders to the main folder of the container
COPY . .
Синтаксис:
RUN <command>
Пример:
# Install the application's dependencies
RUN pip install -r requirements.txt
Синтаксис:
ENTRYPOINT ["command", "argument"]
Пример:
# 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"]
Синтаксис:
docker build <context>
Синтаксис:
docker run <name_of_image>
Контейнеризация и виртуализация: основные концепции