Concepte de containerizare și virtualizare
Julia Ostheimer
Freelance AI Consultant







FROMFROMCOPYRUNENTRYPOINTSintaxă:
FROM <name_of_image>
Exemplu:
# Define the image on which to build
FROM python:3.10
Sintaxă:
COPY <source> <destination>
Exemplu:
# Copy files/folders to the main folder of the container
COPY . .
Sintaxă:
RUN <command>
Exemplu:
# Install the application's dependencies
RUN pip install -r requirements.txt
Sintaxă:
ENTRYPOINT ["command", "argument"]
Exemplu:
# 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"]
Sintaxă:
docker build <context>
Sintaxă:
docker run <name_of_image>
Concepte de containerizare și virtualizare