-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try switching to running powerstrip on the Docker socket.
- Loading branch information
Luke Marsden
committed
Feb 20, 2015
1 parent
a0aaf02
commit 93f2981
Showing
2 changed files
with
23 additions
and
15 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,11 +67,17 @@ Try it out | |
|
||
Powerstrip ships as a Docker image, and adapters can be any HTTP endpoint, including other linked Docker containers. | ||
|
||
Powerstrip expects Docker to have been reconfigured to listen on ``/var/run/docker.real.sock``, and to have ``/var/run`` on the host bind-mounted in at ``/host-var-run``. | ||
|
||
Reconfigure Docker in this way: for example on Ubuntu edit ``/etc/default/docker`` with ``-H unix:///var/run/docker.real.sock`` and then run ``sudo restart docker``. | ||
|
||
This comment has been minimized.
Sorry, something went wrong. |
||
Powerstrip will then create ``/var/run/docker.sock`` from the host's perspective (``/host-var-run/docker.sock`` from inside its container) and normal Docker tools should carry on working as normal. | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
binocarlos
Contributor
|
||
`Slowreq <https://github.com/clusterhq/powerstrip-slowreq>`_ is a trivial Powerstrip adapter (container) which adds a 1 second delay to all create commands. | ||
|
||
Try it out like this (assuming logged into an Ubuntu Docker host). | ||
If you are using ``boot2docker``, who knows. XXX ??? | ||
|
||
If you are using ``boot2docker``, drop the ``sudo`` and also unset ``DOCKER_TLS_VERIFY``. | ||
Try it out like this (assuming logged into an Ubuntu Docker host). | ||
|
||
.. code:: sh | ||
|
@@ -86,22 +92,21 @@ If you are using ``boot2docker``, drop the ``sudo`` and also unset ``DOCKER_TLS_ | |
slowreq: http://slowreq/slowreq-adapter | ||
EOF | ||
$ sudo docker run -d --name powerstrip-slowreq \ | ||
$ sudo DOCKER_HOST="unix:///var/run/docker.real.sock" \ | ||
docker run -d --name powerstrip-slowreq \ | ||
--expose 80 \ | ||
clusterhq/powerstrip-slowreq:v0.0.1 | ||
$ sudo docker run -d --name powerstrip \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
$ sudo DOCKER_HOST="unix:///var/run/docker.real.sock" \ | ||
docker run -d --name powerstrip \ | ||
-v /var/run:/host-var-run \ | ||
-v $PWD/powerstrip-demo/adapters.yml:/etc/powerstrip/adapters.yml \ | ||
--link powerstrip-slowreq:slowreq \ | ||
-p 2375:2375 \ | ||
clusterhq/powerstrip:v0.0.1 | ||
clusterhq/powerstrip:unix-socket # XXX change this to v0.0.2 when releasing | ||
# Note how the second command takes a second longer than the first. | ||
$ time sudo DOCKER_HOST="unix:///var/run/docker.sock.real" \ | ||
This comment has been minimized.
Sorry, something went wrong. |
||
docker run ubuntu echo hello | ||
$ time sudo docker run ubuntu echo hello | ||
$ time DOCKER_HOST=localhost:2375 docker run ubuntu echo hello | ||
**Warning:** Powerstrip exposes the Docker API unprotected on port 2375. | ||
Only use it in private, secure development environments. | ||
**Issues:** If you are using ``SELinux`` and having some issues, disable it or run the following commands: | ||
|
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
Needs a note here that tells the user to
sudo rm /var/run/docker.sock
in case there is an existing socket from an old docker daemon