From daa09f30b00d05dc1a9d8962ebe1add5a434a8d6 Mon Sep 17 00:00:00 2001 From: Thomas Buckley-Houston Date: Sun, 5 Jun 2016 23:51:14 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Change=20Docker-in-Docker=20README=20perspe?= =?UTF-8?q?ctive=20I'm=20not=20even=20a=20newcomer=20to=20DinD=20and=20I?= =?UTF-8?q?=20found=20the=20READEME,=20coupled=20with=20J=C3=A9r=C3=B4me's?= =?UTF-8?q?=20blog=20post,=20confusing.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Firstly, the README doesn't make explicit the oddity of having a Docker image of Docker - I think that Elephant In The Room needs to be acknowledged straight away. Secondly, Jérôme's blog post concludes with a single, unambiguous solution - simply mount the host's Docker socket inside. Personally, I feel that strongly imlpies that that is in fact what DinD has now officially become - a means to create sibling contianers, rather than child containers. However, that is not what the DinD image here does and despite the warnigns in the blog post DinD is actively maintained. I have attempted to make the README more obvious and explicit for first time readers. I'd also argue that the blog post could benefit similarly. I would also like to see a clarification of the differences between the vanilla, git and dind flavours. --- docker/content.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/docker/content.md b/docker/content.md index ee2e0425a..21d836a53 100644 --- a/docker/content.md +++ b/docker/content.md @@ -1,16 +1,23 @@ -# What is Docker? +# What is Docker in Docker? -Docker is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating-system-level virtualization on Linux, Mac OS and Windows. +Although running Docker inside Docker is generally not recommended, there are some legitimate use cases, such as +developing Docker itself. + +_Docker is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating-system-level virtualization on Linux, Mac OS and Windows._ > [wikipedia.org/wiki/Docker_(software)](https://en.wikipedia.org/wiki/Docker_%28software%29) %%LOGO%% +Before running Docker-in-Docker, be sure to read through [Jérôme Petazzoni's excellent blog post on the subject](https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/), where he outlines some of the pros and cons of doing so (and some nasty gotchas you might run into). + +If you are still convinced that you need Docker-in-Docker and not just access to a container's host Docker server, then read on. + # How to use this image [![asciicast](https://asciinema.org/a/24707.png)](https://asciinema.org/a/24707) -## start a daemon instance +## Start a daemon instance ```console $ docker run --privileged --name some-docker -d docker:1.8-dind @@ -20,9 +27,7 @@ $ docker run --privileged --name some-docker -d docker:1.8-dind This image includes `EXPOSE 2375` (the Docker port), so standard container linking will make it automatically available to the linked containers (as the following examples illustrate). -Before running Docker-in-Docker, be sure to read through [Jérôme Petazzoni's excellent blog post on the subject](https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/), where he outlines some of the pros and cons of doing so (and some nasty gotchas you might run into). - -## connect to it from a second container +## Connect to it from a second container ```console $ docker run --rm --link some-docker:docker docker:1.7 version @@ -79,7 +84,7 @@ WARNING: bridge-nf-call-ip6tables is disabled $ docker run --rm --link some-docker:docker docker:git build https://github.com/docker-library/hello-world.git Sending build context to Docker daemon 132.1 kB Step 0 : FROM scratch - ---> + ---> Step 1 : COPY hello / ---> 29bef505052d Removing intermediate container f98aab888906 @@ -109,7 +114,7 @@ Server: OS/Arch: linux/amd64 ``` -## custom daemon flags +## Custom daemon flags ```console $ docker run --privileged --name some-devicemapper-docker -d docker:dind --storage-driver=devicemapper From bd995fbcdc03aecaf15d4670e35a2c886f4176fb Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Wed, 6 Jul 2016 21:49:05 -0700 Subject: [PATCH 2/2] Fix markdownfmt issues --- docker/content.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docker/content.md b/docker/content.md index 21d836a53..06f6c9d95 100644 --- a/docker/content.md +++ b/docker/content.md @@ -1,9 +1,8 @@ # What is Docker in Docker? -Although running Docker inside Docker is generally not recommended, there are some legitimate use cases, such as -developing Docker itself. +Although running Docker inside Docker is generally not recommended, there are some legitimate use cases, such as development of Docker itself. -_Docker is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating-system-level virtualization on Linux, Mac OS and Windows._ +*Docker is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating-system-level virtualization on Linux, Mac OS and Windows.* > [wikipedia.org/wiki/Docker_(software)](https://en.wikipedia.org/wiki/Docker_%28software%29) @@ -84,7 +83,7 @@ WARNING: bridge-nf-call-ip6tables is disabled $ docker run --rm --link some-docker:docker docker:git build https://github.com/docker-library/hello-world.git Sending build context to Docker daemon 132.1 kB Step 0 : FROM scratch - ---> + ---> Step 1 : COPY hello / ---> 29bef505052d Removing intermediate container f98aab888906