skip to Main Content

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

2

Answers


  1. 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

    Login or Signup to reply.
  2. 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/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search