
76 Chapter3: Virtualization & Containerization & Elasticity
1 docker run -p 127.0.0.1:80:9999/tcp ubuntu bash
• What about configuring Memory, CPU, and GPU?
You can configure doer run to accept flags for seing Memory, CPU, and GPU. You can read more
about it here¹⁷⁵ in the official documentation. Here is a brief example of seing the CPU.
1 docker run -it --cpus=".25" ubuntu /bin/bash
is step tells this container to use at max only 25% of the CPU every second.
NVidia Docker GPU
You can run an nvidia-container-runtime¹⁷⁶ here. is process allows you to leverage the power of
containers as well as an NVidia GPU. For instructions on adding this to a Linux ...