当我在 docker 容器的 Graph 文件夹中放入东西时,本地磁盘上的 Graph 文件夹保持为空。
YAML 文件:
# Compose file format version
version: "3.7"
# Contains services where each service contains configurations that will be applied to each container started for that service.
services:
my_web_service:
# Where the Dockerfile is
build: .
working_dir: /my_project
volumes:
- type: volume
source: ./Graph
target: /my_project/Graph
# Interactive Console
stdin_open: True # Same as docker run -i
tty: True # Same as docker run -t
# Declare named volumes and their optional parameters.
volumes:
Graph:
Dockerfile:
FROM python
# Output to terminal in real-time
ENV PYTHONUNBUFFERED 1
# Enable path conversion from Windows-style to Unix-style in volume definitions
ENV COMPOSE_CONVERT_WINDOWS_PATHS=1
RUN mkdir /my_project
WORKDIR /my_project
COPY . /my_project
RUN pip install -r requirements.txt