# Container starts successfully and works, but ShinyProxy says "Container did not respond in time"

**URL:** <https://support.openanalytics.eu/t/container-starts-successfully-and-works-but-shinyproxy-says-container-did-not-respond-in-time/2577>\
**Category:** ShinyProxy\
**Created:** [June 29, 2023, 4:39pm UTC](https://support.openanalytics.eu/t/container-starts-successfully-and-works-but-shinyproxy-says-container-did-not-respond-in-time/2577 "2023-06-29T16:39:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![attached](https://support.openanalytics.eu/letter_avatar_proxy/v4/letter/a/439d5e/32.png) [@attached](https://support.openanalytics.eu/u/attached)\
**Post date:** [June 29, 2023, 4:39pm UTC](https://support.openanalytics.eu/t/container-starts-successfully-and-works-but-shinyproxy-says-container-did-not-respond-in-time/2577/1 "2023-06-29T16:39:49Z")

</div>

When trying to run a MRE for the other post in this forum, I came across a strange problem I could not fix myself.

**The problem also appears identically when using the shinyproxy example images. So I guess it has nothing todo with the specific app.**

The code can be found here (including instructions on what to do):

> **[GitHub - NilsOle/shinyproxy\_debugging](https://github.com/NilsOle/shinyproxy_debugging)**
>
> Contribute to NilsOle/shinyproxy\_debugging development by creating an account on GitHub.

I have an image that works and looks nice.  
I can also start ShinyProxy on port 3839 on the host machine with the following command:

` docker run --publish 3839:8080 -v /var/run/docker.sock:/var/run/docker.sock --rm shinyproxy:latest`

Looks good, too. Now when I want to start the app, ShinyProxy manages to start the app container instance (I can see this when looking at `docker ps`), and when opening the app container instance in a separate window it also works perfectly! But within the app window in ShinyProxy, the app will not appear and show an error instead (logs):

`Container did not respond in time`

> <https://github.com/NilsOle/shinyproxy_debugging/blob/main/output.txt>

output of docker ps after clicking on the app:

```
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
066e1a6e8616 testapp "R -e 'shiny::runApp…" 18 seconds ago Up 17 seconds 0.0.0.0:20100->3838/tcp cool_chatelet
08144db01812 shinyproxy:latest "java -jar /opt/shin…" About a minute ago Up About a minute 0.0.0.0:3839->8080/tcp, :::3839->8080/tcp silly_bartik

```

What am I doing wrong?

**ShinyProxy manages to successfully start the app container instance and there is no R error since I can interact with that very same app container instance without problems, but ShinyProxy would not connect to it.**

Thanks for help.

---

<div class="post-metadata">

**Author:** ![tdekoninck](https://support.openanalytics.eu/user_avatar/support.openanalytics.eu/tdekoninck/32/1079_2.png) [@tdekoninck](https://support.openanalytics.eu/u/tdekoninck)\
**Post date:** [June 30, 2023, 6:41am UTC](https://support.openanalytics.eu/t/container-starts-successfully-and-works-but-shinyproxy-says-container-did-not-respond-in-time/2577/2 "2023-06-30T06:41:44Z")

</div>

Hi

When you run shinyproxy in a container, you have to create a bridge network and specify this as a setting to the app. See [https://github.com/openanalytics/shinyproxy-config-examples/tree/master/02-containerized-docker-engine](https://github.com/openanalytics/shinyproxy-config-examples/tree/master/02-containerized-docker-engine) and [https://github.com/openanalytics/shinyproxy-config-examples/blob/master/02-containerized-docker-engine/application.yml#L25](https://github.com/openanalytics/shinyproxy-config-examples/blob/master/02-containerized-docker-engine/application.yml#L25)

---

<div class="post-metadata">

**Author:** ![attached](https://support.openanalytics.eu/letter_avatar_proxy/v4/letter/a/439d5e/32.png) [@attached](https://support.openanalytics.eu/u/attached)\
**Post date:** [June 30, 2023, 10:40am UTC](https://support.openanalytics.eu/t/container-starts-successfully-and-works-but-shinyproxy-says-container-did-not-respond-in-time/2577/3 "2023-06-30T10:40:27Z")

</div>

Thanks, that solved the problem. For those coming here from Google / ChatGPT:

1. Make sure you have created a docker network with `sudo docker network create sp-example-net` (for example)
2. In application.yml, add `internal-networking: true` to the `docker` section of the proxy settings, as well as `container-network: sp-example-net` to the `container-network` property of your app section
3. Start with `sudo docker run --publish 8080:8080 -v /var/run/docker.sock:/var/run/docker.sock:ro --rm --group-add $(getent group docker | cut -d: -f3) --net sp-example-net shinyproxy:latest`
