RStudio on Mac in docker - rocker RStudio image

I am struggling to setup RStudio server on my Mac for accessing RStudio. I managed to get it to use an additional mounted volume to use as a library where to install as the default - see https://github.com/rkrug/rstudio-server-startup For the scripts and config I used.

But I have a strange problem: I can load e.g. the library rmarkdown from the browser, I can load it when I start an R session in the browser in the Terminal, but running the knit command on an .Rmd file gives me the error Error in loadNamespace(name) : there is no package called ‘rmarkdown’.

Any suggestions what is going on?