Skip to content

Instantly share code, notes, and snippets.

@pasknel
Created June 20, 2019 03:01
Show Gist options
  • Save pasknel/c1438fa4fe8ba2bfa1e19537ac949e0b to your computer and use it in GitHub Desktop.
Save pasknel/c1438fa4fe8ba2bfa1e19537ac949e0b to your computer and use it in GitHub Desktop.
Create a new container
import docker
client = docker.from_env()
image = "alpine"
c = client.containers.run(image, detach = True, tty = True)
print "[+] New container created: {0} ({1})".format(c.short_id, c.name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment