Can't by default install rstudio in an image rstudio/r-base:devel-centos7

I pull the image from official docker hub to local
installed rstudio-server-rhel-1.3.959-x86_64.rpm
you can use following link to get the file and install
RUN wget https://download2.rstudio.org/server/centos6/x86_64/rstudio-server-rhel-1.3.959-x86_64.rpm
RUN yum install rstudio-server-rhel-1.3.959-x86_64.rpm

Then after I install, the error happens when I try to
systemctl start rstudio-server
It saids: “Failed to get D-Bus connection: Operation not permitted”

And I noticed the rstudio-server is not installed in the /usr/lib/systemd/system/ folder as mentioned
it was installed in /etc/init.d/

So even I use some way to address the “fail to get D-Bus connection” problem (If someone need I can post my way, solution in this link: docker - Failed to get D-Bus connection: Operation not permitted - Stack Overflow); I still can’t start the rstudio server service, may be related to it is located in /etc/init.d

Any thoughts about solving this?
My guess is this image didn’t use systemd, so I can’t install and manage the service by systemd, but I don’t know how to use some other way to do this. Or just use a centOS8 image.

I hope to run rstudio-server in the docker, but it needn’t in this specific image, and needn’t managed by systemd for the service.

Can you explain why you want to pull a rstudio Docker image and then install a rstudio rpm? Shouldn’t that already be included in the image? Or am I misunderstanding something?

If you want a fixed version, have you checked if the according Docker image exists?

@bluepuma77 has a good point, although rstudio/r-base is not an rstudio image but a base image containing R packages. The image description also mentions it is experimental. In addition to that, you are using a development version. And you even try to use it as a virtual machine. It isn’t. You can use systemd, that’s not how processes in containers work.

Instead of unstalling rstudio by yourself in a container, I would recommend https://hub.docker.com/r/rocker/rstudio

I think this is what my colleagues are using. The repository you found seems to be some kind of attempt to support pro versions (if that exists).

You are right, I am using rstudio/r-base and it just have R but not rstudio in it.
That’s why I have to install rstudio-server myself.

Yes I could do that, using rocker/rstudio image is kind a way work around and I did try this which solved this problem. But I still try to understand which reason fails me from installing rstudio in the original r-base image, I thought it should be smooth. I did this to figure out unknown knowledge, not for use only.

Maybe it is not about installing, but starting. You can’t start a process in a Docker container using systemctl. Systemd is not part of containers, or just very rarely is. If the rhel package installs one that runs with systemd only for some reason, that won’t work, but systemd just starts processes and manages them, so you should be able to start it directly.

2 Likes

Thank you very much for the explanation, appreciated