Adapt the original dind script and add a description

Upstream-commit: 3c80bd76cf6aa8f6918439f8082b0a8c34fd2c0e
Component: engine
This commit is contained in:
Solomon Hykes
2013-09-06 19:27:48 -07:00
parent c7b1568901
commit ae4d5c759f
+10 -10
View File
@@ -1,5 +1,14 @@
#!/bin/bash
# DinD: a wrapper script which allows docker to be run inside a docker container.
# Original version by Jerome Petazzoni <jerome@dotcloud.com>
# See the blog post: http://blog.docker.io/2013/09/docker-can-now-run-within-docker/
#
# This script should be executed inside a docker container in privilieged mode
# ('docker run -privileged', introduced in docker 0.6).
# Usage: dind CMD [ARG...]
# First, make sure that cgroups are mounted correctly.
CGROUP=/sys/fs/cgroup
@@ -44,13 +53,4 @@ do
done
popd
# If we were given a PORT environment variable, start as a simple daemon;
# otherwise, spawn a shell as well
if [ "$PORT" ]
then
exec docker -d -H 0.0.0.0:$PORT
else
docker -d &
exec bash
fi
exec $*