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

DevOps

MOTOSHARE 🚗🏍️
Turning Idle Vehicles into Shared Rides & Earnings

From Idle to Income. From Parked to Purpose.
Earn by Sharing, Ride by Renting.
Where Owners Earn, Riders Move.
Owners Earn. Riders Move. Motoshare Connects.

With Motoshare, every parked vehicle finds a purpose. Owners earn. Renters ride.
🚀 Everyone wins.

Start Your Journey with Motoshare

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

eg : docker update –cpu-shares 512 219444e11a87

docker inspect 219444e11a87

We can check the value for CPU share to be 512

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.

$ sudo -s

$ docker stop my_container

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

$ docker wait my_container

0