4

I have a Dockerfile like this:

FROM python:3.6
RUN mkdir /code
COPY dist/python-0.1.0.tar.gz /code
WORKDIR /code
RUN pip install python-0.1.0.tar.gz
ENTRYPOINT ["post"]

The "post" command runs my code fine with no arguments. My question is how can I get the docker container to except a local file at runtime because it may change.

Here is my command that runs the script, but says that there is no such file or directory data/output.xml

docker run container data/output.xml

I have also tried this with no luck

docker run -v data:/data containter /data/output.xml

Thank you for any help!

Sarah
  • 669
  • 2
  • 8
  • 21
  • 4
    For those who see this, the answer was just to add docker run -v $(pwd)/data:/data container /data/output.xml – Sarah Oct 09 '17 at 15:56

1 Answers1

6

for docker volumes, I think you need to use the absolute address. The usage is:

$ docker run -tid --name <name_you_want> -v <host_absolute_path>:<path_inside_docker> <image_id> <cmd_such_as_bash>
Koedlt
  • 4,286
  • 8
  • 15
  • 33
Yuze Ma
  • 357
  • 1
  • 9