Running Scala Native in Docker

Now that we’ve established that Docker is running and properly configured, we can hit Ctrl + C in the docker run terminal to shut down our nginx container. Running Scala Native in Docker is just as easy: I’ve published an image called rwhaling/scala-native-book with a full Scala Native installation and all of the code in the book on Docker Hub, so let’s run it like this:

 $ docker run -it -p 8080:8080 rwhaling/scala-native-book
 :scala-native:~ $ ~/book-code #

Unlike nginx, which started the nginx server immediately, this container opens up a shell. In this Appendix, you’ll know you’re in the container environment when you see a prompt like :scala-native:some_directory $, whereas a prompt on your host machine ...

Get Modern Systems Programming with Scala Native now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.