Problems running RStudio via podman?

I am still hoping/struggling to get a supported version of RStudio running under EndlessOS. In the hope not to end (once again) in an unsupported dead end, I found the rocker images for running R/RStudio in docker and rodman for using the rocker images with podman. With the help of the hints of FelixErnst cited by rodman, I succeeded in configuring and starting a container, but I am unable to contact this container neither via FireFox nor via Chrome on localhost:8787. I am puzzled.

Are ports on localhost blocked by flatpak?

There is no telnet nor tcping on EndlessOS, so I have no idea how to check, if the ports are reachable on the commandline.
eos-diagnostic-200706_114657_UTC 0200.txt (829.5 KB)

$ podman container list
CONTAINER ID  IMAGE                          COMMAND  CREATED            STATUS                PORTS                   NAMES
8ae04a917151  docker.io/rocker/verse:latest  /init    About an hour ago  Up About an hour ago  0.0.0.0:8787->8787/tcp  rocker

Hi!

I am getting with our engineers to help us with this.

Hi Byron,

thanks in advance.

to clarify

Are ports on localhost blocked by flatpak?

I suspect that Firefox and Chrome are running in a flatpak environment and thus cannot access localhost:8787 but I don’t know that really. It would explain, why I cannot contact the running container, but I have now idea how I would open up the Firefox flatpak for contacting localhost:8787.

Update: Since upgrade to 3.8.4 and Firefox 78.0.1 I get a “Launch Application” window when I try to contact localhost:8787 and/or myhostname:8787 but neither choosing the system handler does work nor I have an idea which “other application” I should choose.
I append a more current eos-diagnostic-200709_145558_UTC 0200.txt (1.1 MB)

Hi Byron,

any news on this topic?

Bernhard

Please note, that in order to be able to access network ports inside the Podman container, you need to publish the port to the local machine.

So if, for example inside the Container something is listening on Port 8000 and you want to connect to this port from the outside, you have to run the container with:

podman run -dt -p 8000:8000/tcp mycontainer

This will map the local port 8000/TCP to the port 8000/TCP inside the container. Now you can connect from the network to this port which is in turn forwarded to the process running inside the container :slight_smile: I think this is the behavior you want to achieve.

See https://podman.io/getting-started/network.html for more information about this.

Yes, I know, the port is published.
My question is:
Can flatpak’ed Firefox access port 8787 on localhost?

For sure it can, it has permission “network” and can access all network devices reachable by the host. What happens if you open the development toolbar (F12) and switch to the network pane. Then load the URI.

To verify if the port has been published correctly, run:

sudo netstat -nap | grep 8787.*LISTEN

What is the output of this command?

/edit 1:
Just pulled the container and tested it, got the following message in the browser:
image
This means, that the port has been published on the host side, but is not connected inside the container to some process. Getting some error messages inside the container, continuing analysis

/edit 2:
works
Run with

podman run -ti --ulimit="nofile=4096" -p 8787:8787 -e PASSWORD=test rocker/rstudio sh

Then, when inside the container, start the needed services with

/init

Now you can open RStudio in the Browser:


Theres discussion about this, seems like its a bug (it’s closed but still there …)

dear @egrath, thanks a lot, I used your suggestions successfully for starting RSudio in the container and accessing it in the browser.

I opened an issue at github/rocker although it is quite quiet over there …

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