Add argument to allow limiting docker container to s specific amount of memory (#37950)

* Add argument to allow limiting docker container to s specific amount of memory

* Address review comments
This commit is contained in:
Matt Martz 2018-03-26 16:45:50 -05:00 committed by GitHub
commit 5d90ebb28e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 0 deletions

View file

@ -216,6 +216,12 @@ def delegate_docker(args, exclude, require):
'--privileged=%s' % str(privileged).lower(),
]
if args.docker_memory:
test_options.extend([
'--memory=%d' % args.docker_memory,
'--memory-swap=0',
])
docker_socket = '/var/run/docker.sock'
if os.path.exists(docker_socket):