Home > Mobile >  when i want to run my code on docker container i get a path error
when i want to run my code on docker container i get a path error

Time:07-27

I have a python code. The code checks the folder A every 15 seconds and if there is a csv file there, process it and generates an html report with the same name. I want to run my code on a docker container. The code is working without docker. However, when i want to run my code on docker container i get a path error. ( my dockerfile )

Here is my error

These are lines about errors :

1

2

CodePudding user response:

A docker container cannot access the host file system. You need to mount your folder into the container.

docker run docker-hw -v "C:\\path\\host:/path/inside/container"

Then use "/path/inside/container" for the python script.

https://docs.docker.com/storage/bind-mounts/

CodePudding user response:

you are trying to load a local file on your host machine through the script which is running in the docket instance. use the cp command in your yaml file to copy that file to the docket file system, and then just reference it from there

  • Related