Closed donghwan-shin closed 2 years ago
@SepShr I found that there are subprocess.run() for running docker commands. Instead, I found that we can use this docker package: https://docker-py.readthedocs.io/en/stable/index.html#.
subprocess.run()
docker
For example, you can simply get a short ID (of length 12) of a container named 'pylot' as follows:
import docker client = docker.from_env() id = client.containers.get('pylot').short_id
Using subprocess.run() and extracting proper information from its output seems fragile. I recommend using the official docker package. :)
This issue will be closed since the parallel simulation setup uses the docker library extensively in place of shell scripts.
@SepShr I found that there are
subprocess.run()
for running docker commands. Instead, I found that we can use thisdocker
package: https://docker-py.readthedocs.io/en/stable/index.html#.For example, you can simply get a short ID (of length 12) of a container named 'pylot' as follows:
Using
subprocess.run()
and extracting proper information from its output seems fragile. I recommend using the official docker package. :)