Концепції контейнеризації та віртуалізації
Julia Ostheimer
Freelance AI Consultant







FROMFROM COPY RUNENTRYPOINTСинтаксис:
FROM <name_of_image>
Приклад:
# Визначити базовий образ для збірки
FROM python:3.10
Синтаксис:
COPY <source> <destination>
Приклад:
# Скопіювати файли/теки до кореневої теки контейнера
COPY . .
Синтаксис:
RUN <command>
Приклад:
# Встановити залежності застосунку
RUN pip install -r requirements.txt
Синтаксис:
ENTRYPOINT ["command", "argument"]
Приклад:
# Запустити скрипт під час старту контейнера
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>
Концепції контейнеризації та віртуалізації