Docker-py library to automate the execution of docker containers

85 views Asked by At

i was studying docker-py library, using create_container function in that library we can easily create multiple containers, but the thing i want to do here is to pass multiple parameters in this function, In bash the command i am running for creatiion of containers is like this;

docker run -it --cap-add=NET_ADMIN --device /dev/net/tun --name hello1i -v /root/one.txt:/root/one.txt -e VARIABLE='hello-world' -d myimage:hello /bin/bash start.sh

now what i want is to do execute this command using docker-py library , using create_container function, but i am not clear how to pass these ("--cap-ad", "device", "-e") parameters in it ? Can anybody help me ?

0

There are 0 answers