Passing file as argument to Docker container

后端 未结 5 775
名媛妹妹
名媛妹妹 2020-12-29 18:23

A very simple python program, suppose current directory is /PYTHON, I want to pass file.txt as argument to python script boot.py, here is my Dockerfile

FRO         


        
5条回答
  •  感情败类
    2020-12-29 19:10

    You may also make your script read from STDIN and then pass data to docker using cat. Have a look at how to get docker container to read from stdin?

    Something like:

    cat /path/to/file | docker run -i --rm boot python boot.py
    

提交回复
热议问题