Part 1 โ€” Clean Start and Flag Discovery

Clean Existing Containers

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.


Discover Memory Flags

Run:

docker run --help | grep memory

Focus on:


Part 2 โ€” Observe Memory Usage Without Limits

Run 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.