【发布时间】:2020-09-19 13:58:34
【问题描述】:
以下是我的 dockerfile:
FROM python:3.6.5-windowsservercore
COPY . /app
WORKDIR /app
RUN pip download -r requirements.txt -d packages
为了获取图片中的文件列表,我尝试了以下两个选项,但出现错误:
encountered an error during CreateProcess: failure in a Windows system call:
The system cannot find the file specified. (0x2) extra info:
{"CommandLine":"dir","WorkingDirectory":"C:\\app"......
- 运行
docker run -it <container_id> dir - 修改dockerfile并在dockerfile末尾添加CMD -
CMD ["dir"],然后运行docker run <container_id> dir
如何列出docker内的所有目录和文件?
【问题讨论】:
-
请注意,
docker run需要图像名称,而不是容器 ID。图像是您刚刚基于Dockerfile构建的东西,容器是您运行的东西,实例化图像,可以这么说。
标签: docker dockerfile docker-for-windows docker-container docker-image