Skip to content

Instantly share code, notes, and snippets.

@nazarsa
Created November 15, 2016 16:38
Show Gist options
  • Save nazarsa/7ab015ef7110eeac092a7b86bac61fe1 to your computer and use it in GitHub Desktop.
Save nazarsa/7ab015ef7110eeac092a7b86bac61fe1 to your computer and use it in GitHub Desktop.
run docker container and start in terminal - python
#!/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