Derk
Derk

Reputation: 1395

Docker: use file in local folder

I try to run this line via docker (in my home directory, where also the image is):

sudo docker run --rm -v `pwd`:/ne/input -it alexjc/neural-enhance --zoom=1 --model=repair myimage.jpg

This runs fine. However, it cannot find the image. How to set the path correctly? (something with the -v argument I think, but could not find how to use it)

The Python error is

FileNotFoundError: [Errno 2] No such file or directory: 'myimage.jpg'

Upvotes: 2

Views: 534

Answers (1)

Horia Coman
Horia Coman

Reputation: 8781

The image won't be available in the Docker image, unless you include it at build time or make it available via volume mounting.

You should replace the command line with:

sudo docker run --rm -v `pwd`:/ne/input -v `pwd`/myimage.jpg:/path/to/myimage.jpg -it alexjc/neural-enhance --zoom=1 --model=repair /path/to/myimage.jpg

Upvotes: 4

Related Questions