Installing packages for Rstudio Docker

I’m trying to use Rstudio on a DigitalOcean server using the Rstudio docker. Since my experience with linux servers is limited, it’s been a bit of a challenge for me.

I’m able to get Rstudio up and running with:

  • Run jhipster-registry in production
  • Docker java pass startup param to jar
  • Docker Minecraft Host
  • Can Google Kubernetes run Apache Mesos frameworks on top of it?
  • Which Kubernetes component creates a new pod?
  • exec is no use ,I do not know how to solve
  • docker run -dp 8787:8787 -v /root:/home/rstudio/ -e ROOT=TRUE rocker/hadleyverse

    However, I’d like to be able to shut down the server and save it to a snapshot when I’m not using it, but not have to re-install packages each time I do so.

    Using the the docker documentation on updating an image, I am able to create a container, install packages on that container, and then commit the changes:

    docker run -t -i rocker/hadleyverse /bin/bash
    install.r randomForest
    docker commit \<CONTAINER_ID> michael91/ms:v1

    However, once I make the commit, I am unable to run the updated image properly. I try and run it as follows:

    docker run -dp 8787:8787 -v /root:/home/rstudio/ -e ROOT=TRUE michael91/ms:v1

    When I do so, Rstudio server is not activated, as it is when I run the original rocker/hadleyverse version. I’ve tried making commits with and without installing packages; either way it doesn’t seem to work. Obviously I’m doing something incorrectly, but I’m not sure what. If anyone could offer me some guidance, I’d really appreciate it.

    Edit: Thanks a lot VonC; that did the trick.

  • docker postgres failed to start with specified port
  • Request hangs for nginx reverse proxy to an ASP.NET 5 web application on docker
  • How to prevent nodes from restarting in a Kubernetes Deployment
  • why ansible always replaces double quotes with single quotes in templates?
  • How does horizontal scaling decrease load of a system?
  • Cannot login to private docker registry
  • One Solution collect form web for “Installing packages for Rstudio Docker”

    It could be because the new committed image has lost its CMD directive that was present in rocker-org/rocker/rstudio/Dockerfile#L58.

    CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d /supervisord.conf"]

    Try and create a new Dockerfile:

    FROM michael91/ms:v1
    ## Add RStudio binaries to PATH
    ENV PATH /usr/lib/rstudio-server/bin/:$PATH 
    ENV LANG en_US.UTF-8
    EXPOSE 8787
    CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

    And build it as michael91/ms:v2.

    Then see v2 works better than v1 when it comes to activating RStudio:

    docker run -dp 8787:8787 -v /root:/home/rstudio/ -e ROOT=TRUE michael91/ms:v2
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.