Search code examples
scaladockerchisel

java.nio.file.NoSuchFileException: /home/jovyan/work/source/load-ivy.sc


I pulled the almondsh/almond from docker hub

run it using the command

docker run -it --rm -p 8888:8888 almondsh/examples:latest

when i creat a new Scala 3.12 file and try to run the following lines from chisel-bootcamp it gives me an error

val path = System.getProperty("user.dir") + "/source/load-ivy.sc" interp.load.module(ammonite.ops.Path(java.nio.file.FileSystems.getDefault().getPath(path)))

The ERROR message is

java.nio.file.NoSuchFileException: /home/jovyan/work/source/load-ivy.sc

I am new to docker chisel and Kindly help me resolve this problem so i be able to run the chisel examples from the chisel-bootcamp. Thanks in advance


Solution

  • If your file is not present inside the docker image, then you need to mount a folder so that your application iside the container can access a folder on your host machine.

    You can find useful information in the official documentation https://docs.docker.com/engine/reference/commandline/run/