R docker rocker - how to save changes ?

I have seen this:

I have a question, how to save changes in this docker/rocker/rstudio image ? I mean do I have to all the time copy that csv file over there when I open a container ? These same applies to Rsript which I have created. And second question: how to properly save changes and stop container and get out safely ? It was not covered in YT video. Thank you for your help.

Hi there,

You can technically make a whole docker script or make file where you then let the image build with additional assets be it data you want in it or packages etc.

You will have to specify your .csv folder as part of the build when running the container if you want it there before hand yeah. There is more than one way of accessing your docker. In some cases you can mount and then make changes and rerun and it will have some memory. For the most part containers are suppose to be temporary and contained. Easiest is to close and then you can list your dockers that are running and just stop the service. Visualstudio has a whole docker tab where you can just use the UI to stop containers and remove images.

docker stop | Docker Documentation here is the reference to stopping an active container so you can reclaim that port.

Also - have a look here: An Introduction to Docker for R Users - Colin Fay

Hi and thank you,
what to do if during building an image based on Dockerfile I got these errors and process fails and stops ?

ERROR: dependencies ‘ragg’, ‘xml2’ are not available for package ‘pkgdown’

ERROR: dependencies ‘miniUI’, ‘pkgdown’, ‘roxygen2’, ‘rversions’, ‘urlchecker’ are not available for package ‘devtools’

I somehow managed to make a docker image based on Dockerfile, but I can't open it in firefox (localhost:xxxx).
I can run a docker container.
What could be the reason ?
I downloaded rocker/tidyverse image and it opens in browser without any errors and it works. What have I done wrong ? What should be maybe included in Dockerfile to ensure proper connection with a browser. I am on windows 10.

Can you clarify what you mean with this? What service are you exposing through that port? The base image only exposes RStudio Server through port 8787

Thank you for your reply Andresrcs,

I tried to allocate port with: docker run command, but I had difficulty with it and read a few posts and apparently there is a problem with rocker/rstudio. When I have made my image based on rocker/tidyverse that solved a connection problem and now I am able to open/log into my container without any errors. I have one more question about folder structure of the container. If I want to create a folder/folders inside container under defaults rstudio folder what should I write down in Dockerfile:

  1. RUN mkdir -p packages
  2. RUN mkdir packages
  3. RUN mkdir packages/
  4. RUN mkdir /packages, etc.

I do not know which command would be correct.

I think this is getting a little bit out of topic, most of your questions are purely about Docker and whereas it is not against the forum policies, you would have better chances of getting help by asking this on a Docker related forum.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.