Skip to content

Instantly share code, notes, and snippets.

@soreana
Created March 29, 2019 21:49
Show Gist options
  • Save soreana/eac0245fd40212adaf5bd0bbf4f9e529 to your computer and use it in GitHub Desktop.
Save soreana/eac0245fd40212adaf5bd0bbf4f9e529 to your computer and use it in GitHub Desktop.
run docker containers with bash
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