[英]Run every file in a folder with Docker
I have a dockerfile and I want to run every python script in a folder without naming each one, just run every python script in that folder我有一个 dockerfile,我想在一个文件夹中运行每个 python 脚本而不命名每个脚本,只需运行该文件夹中的每个 python 脚本
how can I do so?我该怎么做?
Dockerfile文件
FROM python:3.7.2-alpine3.8
WORKDIR /opt
COPY . /opt
RUN find . -name "*.py" | xargs -n 1 python3
Python files Python文件
#!/usr/local/bin/python3
print("1")
Command命令
docker build -t temp .
Output输出
....
Step 4/5 : RUN find . -name "*.py" | xargs -n 1 python3
---> Running in 68326b65cdda
1
2
1 and 2 are the result of 1.py and 2.py 1和2是1.py和2.py的结果
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.