我编写了一个 docker 文件,将我的 python 脚本添加到容器中:
ADD test_pclean.py /test_pclean.py
我的目录结构是:
.
├── Dockerfile
├── README.md
├── pipeline.json
└── test_pclean.py
我的 json 文件作为在 Pachyderm 中创建管道的配置文件如下:
{
"pipeline": {
"name": "mopng-beneficiary-v2"
},
"transform": {
"cmd": ["python3", "/test_pclean.py"],
"image": "avisrivastava254084/mopng-beneficiary-v2-image-7"
},
"input": {
"atom": {
"repo": "mopng_beneficiary_v2",
"glob": "/*"
}
}
}
即使我复制了官方文档的示例,我也面临一个错误:
python3: can't open file '/test_pclean.py': [Errno 2] No such file or directory
我的 dockerfile 是:
FROM debian:stretch
# Install opencv and matplotlib.
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y unzip wget build-essential \
cmake git pkg-config libswscale-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt
RUN apt update
RUN apt-get -y install python3-pip
RUN pip3 install matplotlib
RUN pip3 install pandas
ADD test_pclean.py /test_pclean.py
ENTRYPOINT [ "/bin/bash/" ]