我有一个读取文件的python脚本,但是当我尝试将其移植到Docker容器时,它抛出了一个错误No such file or directory in python docker
Python:
for root, dirs, files in os.walk(r"//some/LogFiles$"):
for filename in files:
if "RSPowerBI" in filename:
file = filename
with open(fr'//some/LogFiles$/{file}') as fd:
lines = fd.readlines()
停靠文件:
FROM python:3.10.7
RUN pip install --upgrade pip --default-timeout=100 future
WORKDIR /check
COPY . /check
RUN pip install -r requirements.txt
CMD [ "python", "/check/errors.py" ]
对接-组合:
version: '3.1'
services:
bot2:
image: first3
build: ./
restart: always
volumes:
- //some/LogFiles$:/check/some/LogFiles$
1条答案
按热度按时间laik7k3q1#
尝试将Python脚本修改为: