Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Connecting two docker containers and then return result with restful A

Connecting two docker containers and then return result with restful A

I have one container with install ubuntu on that and then install openmodelica for the main container and then have another container that has restful API with python and then I want to run the second container and then connect it with the first one and run openmodelica and then return a result(with CSV file) to first one.

how could I implement it?

Re: Connecting two docker containers and then return result with restful A

The easiest way would be something like:

Code:

$ docker run --network=host -it openmodelica/openmodelica:v1.16.2-minimal

$ docker ps
CONTAINER ID   IMAGE                                       COMMAND       CREATED         STATUS         PORTS     NAMES
2290fa2e1fa6   openmodelica/openmodelica:v1.16.2-minimal   "/bin/bash"   8 seconds ago   Up 6 seconds             eager_easley
$ python3
>>> import OMPython
>>> omc=OMPython.OMCSessionZMQ(dockerContainer="2290fa2e1fa6")
>>> omc.sendExpression("getVersion()")
'OpenModelica 1.16.2'

Re: Connecting two docker containers and then return result with restful A

sorry, but could you explain simply.
how could connect them together?

There are 0 guests and 0 other users also viewing this topic
You are here: