I’m rather unsure if the solution to this will come from Julia, but I’m having a very hard time figuring out how to do this, so I thought I’d ask here.
So, I have a Julia program that I want to run from the command line and which I have put in its own docker container. The program takes a file as input. When I run outside of docker, I give the filename as an argument and it works. When I run the docker container, Julia says it can’t find the file, presumably because the file is not in the container.
Does anyone know how I can get the container to read a file into Julia which is outside the container?
Yeah, it doesn’t really work to just pass a file as a command line argument to the docker container. You either need to ADD/COPY the input file into the docker container itself (i.e. build it into the docker), or as other’s have suggested, using volume mounts, which is essentially telling your docker container to use a volume mount so it can access files there.
Last time I built a Singularity container it just bind mounted my home directory without any further configuration.
Which meant that my .julia directory was just there!
Apologies for doing this one to death…
I just ran up a Singularity container I build in November 2018.
It automatically mounted my home directory AND /var/tmp from the host system.
So you could put your file into /var/tmp
You should be able to use your existing Docker container also.