All Questions
1 question
0
votes
1
answer
2k
views
How can I run the sudo command in Python code under CentOS in Docker
I am trying to access the docker image labels from Python as follows
hostname = socket.gethostname()
cmd = "sudo curl --unix-socket /var/run/docker.sock http:/containers/" + hostname + "/json"
output ...