Forward output from container to ROS

I have a container running with a program which gives me strings. I want to forward those strings to ROS and publish them to a ROS topic. How can this be done? Googleing taught be about an docker ros image you can pull and docker compose but I don’t really get how to combine those… I know how to use ROS but not how to call ROS from my container … Thank you very much!

Greetings

Source: StackOverflow