Created
August 10, 2022 19:23
-
-
Save slashtechno/809e2bbf1984d4380c0d5dfe2ddc40d2 to your computer and use it in GitHub Desktop.
Simple usage of python-on-whales (https://github.com/gabrieldemarmiesse/python-on-whales)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from python_on_whales import docker | |
output = docker.run(image="ubuntu", detach=True, tty=True, interactive=True, publish=[(80, 80), (8080, 8080)], name = "hello", remove=True) | |
# Both are equal | |
print(output) | |
print(docker.container.inspect(output)) | |
docker.container.execute(container = output, command = "bash", tty=True, interactive=True) | |
docker.container.remove(output, force=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment