From a99a8386fdf71c5cc0f7757a5b4ef2747f0d1ea8 Mon Sep 17 00:00:00 2001 From: Jim Alateras Date: Tue, 17 Sep 2013 19:29:13 +1000 Subject: [PATCH 1/4] Update the devenvironment document --- docs/sources/contributing/devenvironment.rst | 25 +++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/docs/sources/contributing/devenvironment.rst b/docs/sources/contributing/devenvironment.rst index 564d6f6580..f151a429f2 100644 --- a/docs/sources/contributing/devenvironment.rst +++ b/docs/sources/contributing/devenvironment.rst @@ -12,7 +12,7 @@ environment defines all build dependencies: system libraries and binaries, go environment, go dependencies, etc. -Step 1: install docker +Step 1: Install Docker ---------------------- Docker's build environment itself is a Docker container, so the first @@ -24,7 +24,7 @@ a working, up-to-date docker installation, then continue to the next step. -Step 2: check out the source +Step 2: Check out the Source ---------------------------- :: @@ -32,8 +32,10 @@ Step 2: check out the source git clone http://git@github.com/dotcloud/docker cd docker +To checkout a different revision just use ``git checkout`` with the name of branch or revision number. -Step 3: build + +Step 3: Build ------------- When you are ready to build docker, run this command: @@ -42,17 +44,22 @@ When you are ready to build docker, run this command: sudo docker build -t docker . -This will build the revision currently checked out in the -repository. Feel free to check out the version of your choice. +This will build a container using the Docketfile in the current directory. Essentially, it will install all the build and runtime dependencies necessary to build and test docker. The first time you execute this command it will take sometime for -If the build is successful, congratulations! You have produced a clean -build of docker, neatly encapsulated in a standard build environment. -You can run an interactive session in the newly built container: +If the build is successful, congratulations! You have produced a clean build of docker, neatly encapsulated in a standard build environment. + + +Step 4: Use Docker +------------------- + +You can run an interactive session in the newly built container: :: - sudo docker run -i -t docker bash + sudo docker run -privileged -i -t docker bash + +To exit the interactive session simply type ``exit``. To extract the binaries from the container: From 089a60c2cfcd17287dc79c5c632eb4775003c3e4 Mon Sep 17 00:00:00 2001 From: Jim Alateras Date: Tue, 17 Sep 2013 21:02:57 +1000 Subject: [PATCH 2/4] Further updates to the dev environment document --- docs/sources/contributing/devenvironment.rst | 27 +++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/sources/contributing/devenvironment.rst b/docs/sources/contributing/devenvironment.rst index f151a429f2..4eba32f322 100644 --- a/docs/sources/contributing/devenvironment.rst +++ b/docs/sources/contributing/devenvironment.rst @@ -16,7 +16,7 @@ Step 1: Install Docker ---------------------- Docker's build environment itself is a Docker container, so the first -step is to install docker on your system. +step is to install Docker on your system. You can follow the `install instructions most relevant to your system `_. Make sure you have @@ -35,8 +35,8 @@ Step 2: Check out the Source To checkout a different revision just use ``git checkout`` with the name of branch or revision number. -Step 3: Build -------------- +Step 3: Build Docker +--------------------- When you are ready to build docker, run this command: @@ -44,13 +44,23 @@ When you are ready to build docker, run this command: sudo docker build -t docker . -This will build a container using the Docketfile in the current directory. Essentially, it will install all the build and runtime dependencies necessary to build and test docker. The first time you execute this command it will take sometime for +This will build a container using the Dockerfile in the current directory. Essentially, it will install all the build and runtime dependencies necessary to build and test docker. This command will take some time to complete when you execute it. -If the build is successful, congratulations! You have produced a clean build of docker, neatly encapsulated in a standard build environment. +If the build is successful, congratulations! You have produced a clean build of docker, neatly encapsulated in a standard build environment. -Step 4: Use Docker +Step 4: Testing the Docker Build +--------------------------------- + +If you have successfully complete the previous steps then you can test the Docker build by executing the following command + +:: + + sudo docker run -lxc-conf=lxc.aa_profile=unconfined -privileged -v `pwd`:/go/src/github.com/dotcloud/docker docker hack/make.sh test + + +Step 5: Use Docker ------------------- You can run an interactive session in the newly built container: @@ -68,3 +78,8 @@ To extract the binaries from the container: sudo docker run docker sh -c 'cat $(which docker)' > docker-build && chmod +x docker-build + +Need More Help? +=============== + +If you need more help then hop on to the #docker-dev IRC channel. From 5797e7e34e3366c9fe65e9d4743014a25910b197 Mon Sep 17 00:00:00 2001 From: Jim Alateras Date: Tue, 17 Sep 2013 21:05:55 +1000 Subject: [PATCH 3/4] Further updates to the dev environment document --- docs/sources/contributing/devenvironment.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/contributing/devenvironment.rst b/docs/sources/contributing/devenvironment.rst index 4eba32f322..64e42e5d53 100644 --- a/docs/sources/contributing/devenvironment.rst +++ b/docs/sources/contributing/devenvironment.rst @@ -44,7 +44,7 @@ When you are ready to build docker, run this command: sudo docker build -t docker . -This will build a container using the Dockerfile in the current directory. Essentially, it will install all the build and runtime dependencies necessary to build and test docker. This command will take some time to complete when you execute it. +This will build a container using the Dockerfile in the current directory. Essentially, it will install all the build and runtime dependencies necessary to build and test docker. This command will take some time to complete when you first execute it. If the build is successful, congratulations! You have produced a clean build of docker, neatly encapsulated in a standard build environment. From 70b731735c810d9e179837eb8761a44fbe98f391 Mon Sep 17 00:00:00 2001 From: Jim Alateras Date: Wed, 18 Sep 2013 12:41:12 +1000 Subject: [PATCH 4/4] Updated the dev environment document --- docs/sources/contributing/devenvironment.rst | 89 ++++++++++++++++---- 1 file changed, 71 insertions(+), 18 deletions(-) diff --git a/docs/sources/contributing/devenvironment.rst b/docs/sources/contributing/devenvironment.rst index 64e42e5d53..51dfc718a2 100644 --- a/docs/sources/contributing/devenvironment.rst +++ b/docs/sources/contributing/devenvironment.rst @@ -3,7 +3,7 @@ :keywords: Docker, documentation, developers, contributing, dev environment Setting Up a Dev Environment -============================ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ To make it easier to contribute to Docker, we provide a standard development environment. It is important that the same environment be @@ -27,7 +27,7 @@ step. Step 2: Check out the Source ---------------------------- -:: +.. code-block:: bash git clone http://git@github.com/dotcloud/docker cd docker @@ -35,51 +35,104 @@ Step 2: Check out the Source To checkout a different revision just use ``git checkout`` with the name of branch or revision number. -Step 3: Build Docker ---------------------- +Step 3: Build the Environment +----------------------------- -When you are ready to build docker, run this command: +This following command will build a development environment using the Dockerfile in the current directory. Essentially, it will install all the build and runtime dependencies necessary to build and test Docker. This command will take some time to complete when you first execute it. -:: + +.. code-block:: bash sudo docker build -t docker . -This will build a container using the Dockerfile in the current directory. Essentially, it will install all the build and runtime dependencies necessary to build and test docker. This command will take some time to complete when you first execute it. If the build is successful, congratulations! You have produced a clean build of docker, neatly encapsulated in a standard build environment. -Step 4: Testing the Docker Build ---------------------------------- +Step 4: Build the Docker Binary +------------------------------- -If you have successfully complete the previous steps then you can test the Docker build by executing the following command +To create the Docker binary, run this command: -:: +.. code-block:: bash + + sudo docker run -lxc-conf=lxc.aa_profile=unconfined -privileged -v `pwd`:/go/src/github.com/dotcloud/docker docker hack/make.sh binary + +This will create the Docker binary in ``./bundles/-dev/binary/`` + + +Step 5: Run the Tests +--------------------- + +To run the Docker test cases you first need to disable `AppArmor `_ using the following commands + +.. code-block:: bash + + sudo /etc/init.d/apparmor stop + sudo /etc/init.d/apparmor teardown + + +To execute the test cases, run this command: + +.. code-block:: bash sudo docker run -lxc-conf=lxc.aa_profile=unconfined -privileged -v `pwd`:/go/src/github.com/dotcloud/docker docker hack/make.sh test -Step 5: Use Docker +If the test are successful then the tail of the output should look something like this + +:: + + --- PASS: TestWriteBroadcaster (0.00 seconds) + === RUN TestRaceWriteBroadcaster + --- PASS: TestRaceWriteBroadcaster (0.00 seconds) + === RUN TestTruncIndex + --- PASS: TestTruncIndex (0.00 seconds) + === RUN TestCompareKernelVersion + --- PASS: TestCompareKernelVersion (0.00 seconds) + === RUN TestHumanSize + --- PASS: TestHumanSize (0.00 seconds) + === RUN TestParseHost + --- PASS: TestParseHost (0.00 seconds) + === RUN TestParseRepositoryTag + --- PASS: TestParseRepositoryTag (0.00 seconds) + === RUN TestGetResolvConf + --- PASS: TestGetResolvConf (0.00 seconds) + === RUN TestCheckLocalDns + --- PASS: TestCheckLocalDns (0.00 seconds) + === RUN TestParseRelease + --- PASS: TestParseRelease (0.00 seconds) + === RUN TestDependencyGraphCircular + --- PASS: TestDependencyGraphCircular (0.00 seconds) + === RUN TestDependencyGraph + --- PASS: TestDependencyGraph (0.00 seconds) + PASS + ok github.com/dotcloud/docker/utils 0.017s + + + + +Step 6: Use Docker ------------------- You can run an interactive session in the newly built container: -:: +.. code-block:: bash sudo docker run -privileged -i -t docker bash -To exit the interactive session simply type ``exit``. + # type 'exit' to exit + To extract the binaries from the container: -:: +.. code-block:: bash sudo docker run docker sh -c 'cat $(which docker)' > docker-build && chmod +x docker-build -Need More Help? -=============== +**Need More Help?** -If you need more help then hop on to the #docker-dev IRC channel. +If you need more help then hop on to the `#docker-dev IRC channel `_ or post a message on the `Docker developer mailinglist `_.