Hi. I have a problem with using my docker-compose file on Balena OS. Whereas it works well on Raspbian, I have problems with getting in running on Balena OS.
After I do “balena push” command all containers are starting fine, but after device reboot containers are stuck in restart loop. I attach all configurations and logs I was able to gather.
Hello Arthur, I had a look at the logs you sent, I see the supervisor reporting the containers being killed and restarted continuously, but I could’t gather more information from those logs regarding what was causing it. Can you attach logs from the terminal, I would be curious to see the individual service logs to see if there is something there that can shed some light on the issue.
Could you maybe also try removing individual services from the file above and checking if the restart loop is still there, it is possible the issues is with one of the services and this could help narrow down where the problem is.
One other thing, does the restart loop eventually resolve itself? From the logs I see a lot of service restarts, but it looks like they also eventually stop and the supervisor just reports being idle
@nazrhom Sometimes yes, sometimes not, sometimes manually restarting resin-supervisor helps. But when I do “balena push myapp” command it always works until reboot.
@nazrhom Here are full logs attaches. Some services are crashing, because dependent services are being killed. I will try remove some services from compose file and see what container causes this issue.
I granted support access if you need to see something: 8b0dce9004e0a2da90be1d6993a3c021
Hello Artur, i’ve used the following tricks in the past when trying to do networking with a mix of host and non-host services.
Use the following hostname depending on your case:
Host to host: use localhost
Host to non-host: use localhost
Non-host to non-host: use service name as defined in docker-compose.yml. Example: webserver
Non-host to host: run ip route | awk '/default / { print $3 }' to figure out the host internal IP address (there might be a better way, if so please comment :))
balenaSound uses most if not all of the cases listed if you are interested in taking a look.
Hello @tmigone. Probably this solution will work for me, but when connecting host to non-host I will need to expose non-host container ports outside container. It’s not secure for me.
As for your concern – can you share a bit more information about your use case, and give an example of how you’d be exposing non-host container ports outside the container? It would be good to understand the larger goal you’re trying to accomplish.
@saintaardvark I wanted to connect containers running in net=host mode with containers running in isolated network. For this I created separate network and assigned containers static IP (everything you can see in docker-compose file I attached)
However, It does not work on balena, because containers are crashing after device reboot (what you can see in this discussion). Removing network helped for this. However, I still need somehow to connect these container or get fixed case with defining own network.
Hi Artur – apologies for missing something, but can you expand a bit on how Tomas’ suggestion up above won’t work for you? You said that you would need to expose non-host container ports outside the container, and that it’s not secure for you. Can you please give details here? I want to make sure I understand your case.
Hey Artur, just checking in to see if you found a workaround for this problem. If not, care to give us a few more details as requested by Hugh above? Thanks!
Hi. Sorry for no response. I deleted all network definitions from compose file and used workaround mentioned in this thread by @tmigone to find needed IP addresses.