Owen McMahon
10/13/2021, 9:30 PMhost_config arg of DockerRun, however looking at the Docker Python SDK docs, it appears the ports for forwarding have to additionally be passed into the create_container() function (https://docker-py.readthedocs.io/en/stable/api.html#docker.api.container.ContainerApiMixin.create_container), which looking at the prefect source code, is not an additional arg I can pass into the run configs of DockerRun to thus be sent into create_container(). So, doesn't seem possible.
This feels like something pretty common and doable, and I'm guessing I'm just looking at it the wrong direction. Has anyone accomplish this before and have any suggestions? Thanks!emre
10/13/2021, 10:17 PMcreate_container is called by the docker agent, and it currently doesn't receives a ports kwarg at all. So it doesn't seem possible at this point.
I believe the agent passes down the host_config of DockerRun correctly, so the only thing missing is delivering a simple list to the DockerAgent .
This would be a simple feature to add, why not open a issue/PR?Kevin Kho
Owen McMahon
10/14/2021, 1:02 PM