Assignment 2 for Docker Day 1

Q1. – What is the use of “docker update” commands? with example and image

  • “docker update” is used to limit the usage of resources a container can use.
  • CPU usage can be limited by CPU time, no.of CPUs used, or which CPUs are used.
  • Memory usage can be limited for Main Memory as well as Swap
  • Disk IO can be limited by specifying a relative weight.
  • No.of PIDs container can allocate can be limited.
  • This command can also be used to specify the restart policy when container exits.

Q2. – What is the use of “docker wait” commands? with example and image
“docker wait” waits till the container exits and then prints its exit code.
The exit code indicates what was returned by the parent process (PID 1) in the container.
In success case, exit code is 0.

Q3. – List of Top 5 docker images from hub.docker.com and create a running container of it and try to use it
nginx, alpine, python, httpd, rabbitmq