Skip to content
loading...

What is the equivalent command for docker port CONTAINER in docker-py

aadityark profile image aadityark github logo ・1 min read

I trying to automate a docker server using docker-py. Need to check whether the host URL is pinging or not using python. Hence I need an equivalent command in python for docker port container

import docker
client = docker.from_env()
print(client.port('c03ebfb53a7d', 80))

twitter logo DISCUSS
Discussion
markdown guide
Classic DEV Post from Jul 30 '19

PublishTo.Dev: Scheduling article publishing on dev.to

aadityark profile image
I have 2+ years of experience in the Software Engineering industry and my expertise is as follows