Check whether containers are currently running:
docker ps -q
If any containers are running, stop them:
docker kill $(docker ps -q)
Now start with a clean environment.
Run:
docker run --help | grep memory
Focus on:
-memory-memory-reservation-memory-swapRun MongoDB (BusyBox barely consumes memory, so it is not useful for this test):
docker run -d --rm \
--name mongodb \
mongodb/mongodb-community-server:7.0-ubuntu2204
If the image does not exist locally, Docker will pull it automatically.