From 24c180fe2ab50caca4631b4df362f03ca7f32339 Mon Sep 17 00:00:00 2001 From: blusky-cloud <72573224+blusky-cloud@users.noreply.github.com> Date: Thu, 13 May 2021 09:25:00 -0700 Subject: [PATCH] instructions to limit RAM use --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 38b1345..d4409fc 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Our dockerfile consists of all project dependancies required to run each of our - Change directory to the docker-tutorial folder - Build the Dockerfile.buster and wait for the process to finish - Run the docker image as *-id* interactive and detached so it is running in the background +- Note: Read below section on RAM use before running for the first time! ```shell git clone https://github.com/PortlandStatePowerLab/docker-tutorial @@ -17,6 +18,15 @@ cd docker-tutorial docker build --file Dockerfile.buster --tag psu-dev . docker run -id psu-dev ``` +### Creeping Host Machine RAM Use +Note: It is a well-documented problem that docker containers will "creep," their use of the host machine's RAM. To solve this problem, you can specify a limit to the RAM used by the container. This link contains more details: https://docs.docker.com/config/containers/resource_constraints/ + +To do this for the above instructions, you can try replacing `docker run -id psu-dev` with the following: + +```shell +docker run -id -m "4g" psu-dev +``` +Where the `"4g"` in quotes is the RAM ceiling for the container (in gigabytes, as specified by the g). ## Saving/Loading Image I have found that my machine will delete images after a system update. This is actually a common issue that will hopefully be fixed soon. If you have room on your machine, approximatly 3 GB, I recommend saving the image to a tar file so that you can always reload the image if something happens.