Assignment Day 2 – Explain docker update & docker wait commands with example

DevOps

YOUR COSMETIC CARE STARTS HERE

Find the Best Cosmetic Hospitals

Trusted • Curated • Easy

Looking for the right place for a cosmetic procedure? Explore top cosmetic hospitals in one place and choose with confidence.

“Small steps lead to big changes — today is a perfect day to begin.”

Explore Cosmetic Hospitals Compare hospitals, services & options quickly.

✓ Shortlist providers • ✓ Review options • ✓ Take the next step with confidence

docker update

The docker update command dynamically updates container configuration. You can use this command to prevent containers from consuming too many resources from their Docker host

eg : docker update –cpu-shares 512 317e428b3427(share cpu)

docker update --cpu-shares 512 -m 300M 166eb15bcb01(Update a container with cpu-shares and memory)Code language: JavaScript (javascript)

you can check with the docker inspect 166eb15bcb01 command

docker wait

Start a container in the background.

$ docker run -dit --name=my_container ubuntu bash

Run docker wait, which should block until the container exits.

$ docker wait my_container

In another terminal, stop the first container. The docker wait command above returns the exit code.

$ docker stop my_container

This is the same docker wait command from above, but it now exits, returning 0.

$ docker wait my_container
0