You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After creating a Container object and starting it, the container's attrs field still says the container is not running.
Only when creating a new Container object does the attrs field show the correct status.
I wonder if any other fields of the attrs attribute are affected?
Here is ascript demonstrating the problem:
importdockerfromtimeimportsleepclient=docker.from_env()
container=client.containers.create("nginx")
container.start()
sleep(5)
print(container.attrs["State"]["Running"]) # prints Falseprint(client.containers.get(container.id).attrs["State"]["Running"]) # prints True
The text was updated successfully, but these errors were encountered:
After creating a Container object and starting it, the container's
attrs
field still says the container is not running.Only when creating a new Container object does the
attrs
field show the correct status.I wonder if any other fields of the
attrs
attribute are affected?Here is ascript demonstrating the problem:
The text was updated successfully, but these errors were encountered: