Prasanth Kothuri
11/09/2021, 6:30 PM-p 12001:12001
Kevin Kho
client.api.create_host_config(port_bindings={
12001:12001
})
In Prefect it would be like:
DockerRun(...,host_config={"port_bindings" = {12001:12001}})
Prasanth Kothuri
11/09/2021, 6:59 PM# flow run time configuration
f.run_config = DockerRun(
labels=["dt4dev_osdataproc"],
image="<http://gitlab-registry.internal.sanger.ac.uk/pam-dt4/spark-service/spark-service-docker/spark-app:v0.3|gitlab-registry.internal.sanger.ac.uk/pam-dt4/spark-service/spark-service-docker/spark-app:v0.3>",
host_config={"port_bindings":{12001:12001}},
env={"rpc_port": "12001","bm_port": "12101"}
)
when I execute the flow I don't see the port mapping on docker ps
root@dt4-prefect:~/prefect# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
079f58a79463 <http://gitlab-registry.internal.sanger.ac.uk/pam-dt4/spark-service/spark-service-docker/spark-app:v0.3|gitlab-registry.internal.sanger.ac.uk/pam-dt4/spark-service/spark-service-docker/spark-app:v0.3> "/usr/bin/entrypoint…" 10 seconds ago Up 9 seconds pearl-tiger
Kevin Kho
ports
kwarg is not exposed. If what you tried doesn’t work, I think we need to open an issue
client.api.create_container(
'busybox', 'ls', ports=[1111, 2222],
host_config=client.api.create_host_config(port_bindings={
1111: 4567,
2222: None
})
)
Prasanth Kothuri
11/10/2021, 5:27 PMhost_config={"network_mode":"host"},
this should make all the ports reachable ?Kevin Kho