Skip to content

Commit 71a81d5

Browse files
author
Danny Sauer
committed
Initial version
TODO: fix this stuff * hardcoded number of containers * hardcoded sleep * serial container creation * no logging
1 parent c3eef80 commit 71a81d5

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

misc/dockerstress.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env python3
2+
3+
import docker
4+
from time import sleep
5+
6+
client = docker.from_env()
7+
containers = []
8+
for i in range(1,50):
9+
host = f"stresshost_{i}"
10+
cont = client.containers.run(
11+
"busybox",
12+
"/bin/httpd -fh /etc",
13+
hostname=host,
14+
name=host,
15+
remove=True,
16+
detach=True,
17+
)
18+
containers.append(cont)
19+
20+
sleep(5)
21+
for cont in containers:
22+
cont.kill()
23+
#cont.remove()

0 commit comments

Comments
 (0)