Sign inSign up

xinfengliu/testoom

By xinfengliu

Updated over 8 years ago

Image
0

76

xinfengliu/testoom repository overview

Test container out of memory

test.sh
#!/bin/sh
SIZE=1
[ $# -gt 0 ] && SIZE=$1
echo Allocate Memory Size: "$SIZE MB"
yes | tr \\n x | head -c $((1024*1024*$SIZE)) | grep n
Dockerfile
FROM busybox
ADD test.sh /
#ENTRYPOINT ["sh", "-x", "/test.sh"]
ENTRYPOINT ["/test.sh"]
CMD []
Run

docker service create --name testoom --restart-delay 10s --limit-cpu 1.0 --limit-memory 4m testoom 8

Tag summary

Content type

Image

Digest

Size

706.4 kB

Last updated

over 8 years ago

docker pull xinfengliu/testoom:0.1