Complete the code to set a memory limit of 500MB for a Docker container.
docker run --memory=[1] myappThe correct flag value is 500m which means 500 megabytes. Docker expects memory limits in bytes or with suffixes like 'm' for megabytes.
Complete the code to reserve 200MB of memory for a Docker container.
docker run --memory-reservation=[1] myappThe memory reservation flag expects a value like 200m for 200 megabytes.
Fix the error in the command to limit memory to 1GB.
docker run --memory=[1] myappThe correct suffix for gigabytes is lowercase 'g'. So 1g means 1 gigabyte.
Fill both blanks to set a memory limit of 750MB and a reservation of 500MB.
docker run --memory=[1] --memory-reservation=[2] myapp
Memory limits and reservations require lowercase suffixes like 'm' for megabytes. So 750m and 500m are correct.
Fill all three blanks to set a memory limit of 2GB, a reservation of 1GB, and swap memory limit of 3GB.
docker run --memory=[1] --memory-reservation=[2] --memory-swap=[3] myapp
Use lowercase 'g' suffix for gigabytes. So 2g, 1g, and 3g are correct for memory limits, reservation, and swap respectively.