Created
March 29, 2019 21:49
-
-
Save soreana/eac0245fd40212adaf5bd0bbf4f9e529 to your computer and use it in GitHub Desktop.
run docker containers with bash
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
import docker | |
import dockerpty | |
client = docker.APIClient(base_url='unix://var/run/docker.sock') | |
container = client.create_container( | |
image='mininet', | |
stdin_open=True, | |
tty=True | |
# command='/bin/sh', | |
) | |
client.start(container) | |
dockerpty.start(client, container) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment