summaryrefslogtreecommitdiff
path: root/docs/machine.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/machine.md')
-rw-r--r--docs/machine.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/machine.md b/docs/machine.md
new file mode 100644
index 0000000..d38316e
--- /dev/null
+++ b/docs/machine.md
@@ -0,0 +1,19 @@
+# Using with Docker Toolbox and Machine
+
+In development, we recommend using [Docker Toolbox](https://www.docker.com/products/docker-toolbox) to set up Docker. It includes a tool called Machine which will create a VM running Docker Engine and point your shell at it using environment variables.
+
+To configure docker-py with these environment variables
+
+First use Machine to set up the environment variables:
+```bash
+$ eval "$(docker-machine env)"
+```
+
+You can then use docker-py like this:
+```python
+import docker
+client = docker.from_env(assert_hostname=False)
+print client.version()
+```
+
+**Note:** We are disabling TLS hostname checking with `assert\_hostname=False`. Machine provides us with the exact certificate the server is using so this is safe. If you are not using Machine and verifying the host against a certificate authority, you'll want to enable this.