# Docker, Rocker and other things

Continuing what I’ve started already with the post about blogdown where I’ve advertised how easy it is to use blogdown for all you blogging needs, today I want to do the same about Docker. If you don’t know what Docker is, there is a video from useR!2017 that started the process for me and where Daniel Nust explains what it is and why you should care.

But more specifically, for hands-on tutorial I went with ROpenSci tutorial. Overall, it is quite good, but I did come across couple of things I wanted others to avoid so if you are thinking about following the tutorial, here is a very short list of things I’ve noticed to be a little bit off in the tutorial:

1. I’ve experienced some weird hangs while running the docker images. I’m fairly certain it has little to do with the actual image, but the only way to unhang is docker kill <container_id> and then restart the image with sudo docker run --rm -p 8787:8787 -v /home/misha/R/projects/rocker-tutorial:/home/rstudio/rocker-tutorial verse_gapminder.

2. docker login no longer needs/accepts email. Putting just your username is enough for it to ask your password. You can also add your password to login, but it’ll be in plain text, so maybe not a great idea.

3. Tutorial is making a refence at multiple points to a file with location data/gapminder-FiveYearData.csv. I guess I’ve missed the point where it was created, so I didn’t have it. Specifically, when I’ve got to the part with ADD in Dockerfile I’ve came across the problem that since I don’t have that file I wasn’t able to add it into the build process. On the bright side, I was forced to look into the docker build process a bit more and came across this blog where author talks about context. In short, everything in the same folder as Dockerfile will be added to it’s context. That means that using ADD file.txt will only succeed if file.txt is inside the same folder as Dockerfile. So, I’ve just copied one file to the same folder and used ADD script.r /home/rstudio/ and then used sudo docker build -t my-r-image . successfuly.

Other than that I didn’t have any issues with following the tutorial and after following it, Docker definitely is less daunting than it used to be.