published at https://hub.docker.com/r/aufi/memconsumer/
[maufart@nb 04103589aaf3d14b973880967266fd37]$ docker build . -t memconsumer Sending build context to Docker daemon 58.37kB Step 1/2 : from centos:7 ---> ff426288ea90 Step 2/2 : COPY memconsumer /bin/memconsumer ---> Using cache ---> b7cf1976739b Successfully built b7cf1976739b Successfully tagged memconsumer:latest [maufart@nb 04103589aaf3d14b973880967266fd37]$ [maufart@nb 04103589aaf3d14b973880967266fd37]$ [maufart@nb 04103589aaf3d14b973880967266fd37]$ docker run --memory 100m -it memconsumer [root@6f6174d12a07 /]# exit exit [maufart@nb 04103589aaf3d14b973880967266fd37]$ docker run --memory 100m -it memconsumer memconsumer Starting memory consumer.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. Increasing allocated memory.. [maufart@nb 04103589aaf3d14b973880967266fd37]$ echo $? 137