refresh container.attrs
See original GitHub issueFollowing code runs into a problem:
container = docker.from_env().containers.create(image=...)
container.start()
ip = container.attrs["NetworkSettings"]["Networks"]["bridge"]["IPAddress"]
# ip == "" :(, but I get it.
time.sleep(...)
ip = container.attrs["NetworkSettings"]["Networks"]["bridge"]["IPAddress"]
# ip == "" :(, still ???:-(???
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
Containers — Docker SDK for Python 6.0.1 documentation
Detailed configuration may be accessed through the attrs attribute. Note that local attributes are cached; users may call reload() to query the Docker...
Read more >AttributeContainer | Apple Developer Documentation
AttributeContainer provides a way to store attributes and their values outside of an attributed string. You use this type to initialize an instance...
Read more >Update a running container - Docker - Stack Overflow
The first command simply restarts the container with your new settings. The second command deletes the old container and creates a new one...
Read more >Refreshing an Amazon ECS Container Instance Cluster With a ...
In this post, I show you how to manually refresh the container instances in an active ECS cluster with new container instances built...
Read more >How To Update Docker Container automatically with nearly ...
How to update docker container automatically with Watchtower. Scheduled updates without downtime for your entire docker environment.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this is the same problem that I was about to open an issue for – the documentation for running a container does not mention that
Container.attrs
is cached (specifically in thedetach=True
example). TheContainer.reload
method is not mentioned in the documentation (nor iswait
by the way), is this an oversight or should it not be called?my code for running a command in two docker images ended up looking like this:
should the
wait
method onContainer
be updated to perform a reload before returning?I have run into a similar problem with myself – try running
container.reload()