コンテナ化と仮想化の基礎概念
Julia Ostheimer
Freelance AI Consultant







FROM 命令FROM COPY RUNENTRYPOINT構文:
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>
コンテナ化と仮想化の基礎概念