Created
November 15, 2016 16:38
-
-
Save nazarsa/7ab015ef7110eeac092a7b86bac61fe1 to your computer and use it in GitHub Desktop.
run docker container and start in terminal - python
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
#!/usr/bin/env python | |
#Step 1 pip install dockerpty | |
import docker | |
import dockerpty | |
client = docker.Client() | |
container = client.create_container( | |
image='busybox:latest', | |
stdin_open=True, | |
tty=True, | |
command='/bin/sh', | |
) | |
dockerpty.start(client, container) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment