Using embedr With Docker

This is a description of how I use embedr inside Docker on Linux. I have a directory called "docker" that I use to hold an R file that I want to run, titled "program.R".

mkdir ~/docker
cd ~/docker

I place a copy of this Dockerfile into that directory. I build it with the command

docker build -t myr .

That creates a new Docker image by the name of "myr". It can then be built

docker run -v /home/lance/docker:/code myr

The -v option allows me to mount the docker directory as "/code" inside the Docker image. If I didn't care about saving the results (which would be weird, but whatever floats your boat) I could just do

docker run myr