first commit
This commit is contained in:
commit
69cbfff5eb
3 changed files with 78 additions and 0 deletions
27
test.py
Executable file
27
test.py
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env python3
|
||||
import time
|
||||
|
||||
import docker
|
||||
client = docker.from_env()
|
||||
|
||||
#container_list = []
|
||||
|
||||
"""
|
||||
for i in range(0, 10):
|
||||
print(f"Creating container {i}")
|
||||
container = client.containers.run("zhaozuohong/logisim", detach=True, remove=True, ports={"10000/tcp": 60000 + i})
|
||||
container_list.append(container)
|
||||
"""
|
||||
|
||||
print(f"Creating container...")
|
||||
|
||||
container = client.containers.run("zhaozuohong/logisim", detach=True, remove=True, ports={"10000/tcp": 60000})
|
||||
time.sleep(3)
|
||||
while True:
|
||||
#while (container.status == "running"):
|
||||
time.sleep(2)
|
||||
container.reload()
|
||||
print(container.status)
|
||||
|
||||
print("container stopped.")
|
||||
#container_list.append(container)
|
Loading…
Add table
Add a link
Reference in a new issue