Search code examples
dockershinyproxy

Why does "Docker startup options" of the ShinyProxy "Getting Started" manual state 127.0.0.1:2375?


The Getting started page of ShinyProxy states to do the following. I will reproduce this so we're all on the same page.

---------- start reproduction ----------

sudo systemctl edit docker

This command opens your default editor, add the following content to the file:

[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H unix:// -D -H tcp://127.0.0.1:2375

Next, save the file, close the editor and restart Docker using:

sudo systemctl restart docker

---------- end reproduction ----------

If I perform these steps and set url: http://localhost:2375 in the application.yml my shiny app containers fail to start.

docker logs return errors such as:

  • Container with index 0 failed to start
  • Docker container failed to start
  • Connect to localhost:2375 [localhost/127.0.0.1] failed: Connection refused (Connection refused)

However, if I set both url: http://172.17.0.1:2375 in the application.yml and ExecStart=/usr/bin/dockerd -H unix:// -D -H tcp://172.17.0.1:2375 in "Docker startup options" it works. 172.17.0.1 is the IPv4 address for docker0 on my host system. The application.yml also defines internal-networking: true.

I am running shinyproxy 3.0.2 via its docker image ( openanalytics/shinyproxy:3.0.2).

Can someone explain this?


Solution

  • It seems like the key to the described behaviour is that ShinyProxy is being run via docker container (openanalytics/shinyproxy:3.0.2), which will "simply" not allow networking via localhost/127.0.0.1.

    Presumably networking should run in a docker specific manner e.g. via 172.17.0.1:2375 or docker.sock.

    My conclusion is that the "Getting started" page is a description if you want to run the standalone java application and not its dockerized version.

    FWIW:
    I've now switched to the following docker settings in the application.yaml, which also do not require the docker startup options to be edited. Setting url seems not to be strictly needed if setting internal-networking: true.

    docker:
        internal-networking: true
        url: unix:///var/run/docker.sock