Published: Thu 22 February 2018
By Stephen Childs
In misc .
tags: Docker R
Since I returned to work today after the long weekend,
I was able to get Docker running on my Windows machine there.
It actually worked quite well, though I had to reboot the machine
a few times.
The one part that I could not get to work was mounting folders on
my shared drives from inside the container.
This is not that big a problem, since I can still use my computer's
built in storage.
This actually has some performance benefits, because it can be very
slow writing large files over the network.
That is probably the biggest change in workflow that I have to make by moving
my R projects over to Docker -- I can't generate reports in the volumes shared
by the container and the host machine. It was working, but it turned out to
be quite unreliable.
Since I would like to store my code in a shared volume,
that leaves me with having to change how this works.
Instead of changing the output directory of the `rmarkdown::render``
function, I decided to copy everything that is necessary to generate the
report (including the SQLite database file) over to a working directory
that isn't mirrored.
Then once the reports are generated, the new files can be copied back.
I don't like the idea of copying the database, so I am now looking into
having that run in a separate container and I could change the connection
that I'm using.
Thankfully, almost all my software is now installed on my new machine.