แนวคิดการ Containerization และ Virtualization
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>
แนวคิดการ Containerization และ Virtualization