From fc559d999256a8171015f18fd67e51c39ea5aa32 Mon Sep 17 00:00:00 2001 From: David Mcanulty Date: Mon, 6 Jan 2014 09:29:56 -0800 Subject: [PATCH 01/32] Fixed error in group add example There is no ${USERNAME} in bash, only ${USER} --- docs/sources/use/basics.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sources/use/basics.rst b/docs/sources/use/basics.rst index 8c896ae79..de0419356 100644 --- a/docs/sources/use/basics.rst +++ b/docs/sources/use/basics.rst @@ -78,11 +78,11 @@ client commands. # Add the docker group if it doesn't already exist. sudo groupadd docker - # Add the connected user "${USERNAME}" to the docker group. + # Add the connected user "${USER}" to the docker group. # Change the user name to match your preferred user. # You may have to logout and log back in again for # this to take effect. - sudo gpasswd -a ${USERNAME} docker + sudo gpasswd -a ${USER} docker # Restart the docker daemon. sudo service docker restart From 82531f71681c9b5bc5a6c871f81ef67f9e92d708 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Mon, 6 Jan 2014 11:11:04 -0800 Subject: [PATCH 02/32] fix error on docker wait --- commands.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/commands.go b/commands.go index aab0bb963..95098ffd4 100644 --- a/commands.go +++ b/commands.go @@ -2510,11 +2510,7 @@ func (cli *DockerCli) LoadConfigFile() (err error) { func waitForExit(cli *DockerCli, containerId string) (int, error) { body, _, err := cli.call("POST", "/containers/"+containerId+"/wait", nil) if err != nil { - // If we can't connect, then the daemon probably died. - if err != ErrConnectionRefused { - return -1, err - } - return -1, nil + return -1, err } var out APIWait From 0eb5f233d68e9a6ec6e0643cc17355ac5ffdfe06 Mon Sep 17 00:00:00 2001 From: Sven Dowideit Date: Wed, 8 Jan 2014 10:17:15 +1000 Subject: [PATCH 03/32] give more specific advice on setting up signing Docker-DCO-1.0-Signed-off-by: Sven Dowideit (github: SvenDowideit) --- CONTRIBUTING.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1caf9c8d7..c09d13aa7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -129,12 +129,27 @@ d. I understand and agree that this Project and the contribution are publicly kn e. I hereby grant to the Project, Docker, Inc and its successors; and recipients of software distributed by the Project a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, modify, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute this contribution and such modifications and derivative works consistent with this Project, the open source license indicated in the previous work or other appropriate open source license specified by the Project and approved by the Open Source Initiative(OSI) at http://www.opensource.org. ``` -then you just add a line saying +then you just add a line to every git commit message: Docker-DCO-1.0-Signed-off-by: Joe Smith (github: github_handle) using your real name (sorry, no pseudonyms or anonymous contributions.) +One way to automate this, is customise your get ``commit.template`` by adding +the following to your ``.git/hooks/prepare-commit-msg`` script (needs +``chmod 755 .git/hooks/prepare-commit-msg`` ) in the docker checkout: + +``` + #!/bin/sh + # Auto sign all commits to allow them to be used by the Docker project. + # see https://github.com/dotcloud/docker/blob/master/CONTRIBUTING.md#sign-your-work + # + GH_USER=$(git config --get github.user) + SOB=$(git var GIT_AUTHOR_IDENT | sed -n "s/^\(.*>\).*$/Docker-DCO-1.0-Signed-off-by: \1 \(github: $GH_USER\)/p") + grep -qs "^$SOB" "$1" || echo "\n$SOB" >> "$1" + +``` + If you have any questions, please refer to the FAQ in the [docs](http://docs.docker.io) From 13ebc68636f922e799d71792748934b8883d2f1f Mon Sep 17 00:00:00 2001 From: zimbatm Date: Fri, 27 Dec 2013 15:18:40 +0000 Subject: [PATCH 04/32] Makes sure the GPG key fingerprint is inlined in the doc everywhere. Instead of `curl $url | apt-get add -` use the ubuntu keyserver and a full fingerprint to retreive the key. This makes the distribution of the GPG key more secure an less likely to change even if 3rd party gains access to the packages repository. Docker-DCO-1.0-Signed-off-by: Jonas Pfenniger (github: zimbatm) --- Vagrantfile | 2 +- docs/sources/installation/ubuntulinux.rst | 12 ++++-------- docs/sources/installation/upgrading.rst | 2 +- hack/infrastructure/docker-ci/deployment.py | 2 +- hack/install.sh | 2 +- hack/release.sh | 2 +- 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index def85e5d7..c13058782 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -24,7 +24,7 @@ if [ -z "$user" ]; then fi # Adding an apt gpg key is idempotent. -wget -q -O - https://get.docker.io/gpg | apt-key add - +apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 # Creating the docker.list file is idempotent, but it may overwrite desired # settings if it already exists. This could be solved with md5sum but it diff --git a/docs/sources/installation/ubuntulinux.rst b/docs/sources/installation/ubuntulinux.rst index e4432c671..848097909 100644 --- a/docs/sources/installation/ubuntulinux.rst +++ b/docs/sources/installation/ubuntulinux.rst @@ -68,13 +68,11 @@ easy. **See the :ref:`installmirrors` section below if you are not in the United States.** Other sources of the Debian packages may be faster for you to install. -First add the Docker repository key to your local keychain. You can use the -``apt-key`` command to check the fingerprint matches: ``36A1 D786 9245 C895 0F96 -6E92 D857 6A8B A88D 21E9`` +First add the Docker repository key to your local keychain. .. code-block:: bash - sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -" + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 Add the Docker repository to your apt sources list, update and install the ``lxc-docker`` package. @@ -142,13 +140,11 @@ Docker is available as a Debian package, which makes installation easy. Please note that these instructions have changed for 0.6. If you are upgrading from an earlier version, you will need to follow them again. -First add the Docker repository key to your local keychain. You can use the -``apt-key`` command to check the fingerprint matches: ``36A1 D786 9245 C895 0F96 -6E92 D857 6A8B A88D 21E9`` +First add the Docker repository key to your local keychain. .. code-block:: bash - sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -" + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 Add the Docker repository to your apt sources list, update and install the ``lxc-docker`` package. diff --git a/docs/sources/installation/upgrading.rst b/docs/sources/installation/upgrading.rst index ac4170dfb..c76011554 100644 --- a/docs/sources/installation/upgrading.rst +++ b/docs/sources/installation/upgrading.rst @@ -26,7 +26,7 @@ use ``apt-get`` to upgrade. .. code-block:: bash # Add the Docker repository key to your local keychain - sudo sh -c "curl https://get.docker.io/gpg | apt-key add -" + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 # Add the Docker repository to your apt sources list. sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" diff --git a/hack/infrastructure/docker-ci/deployment.py b/hack/infrastructure/docker-ci/deployment.py index 8fb0766bf..fd0fdb0fe 100755 --- a/hack/infrastructure/docker-ci/deployment.py +++ b/hack/infrastructure/docker-ci/deployment.py @@ -127,7 +127,7 @@ call('/usr/bin/rsync -aH {} {}@{}:{}'.format(DOCKER_CI_PATH, DO_IMAGE_USER, ip, # Install Docker and Buildbot dependencies sudo('mkdir /mnt/docker; ln -s /mnt/docker /var/lib/docker') -sudo('wget -q -O - https://get.docker.io/gpg | apt-key add -') +sudo('apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9') sudo('echo deb https://get.docker.io/ubuntu docker main >' ' /etc/apt/sources.list.d/docker.list') sudo('echo -e "deb http://archive.ubuntu.com/ubuntu raring main universe\n' diff --git a/hack/install.sh b/hack/install.sh index a22bb5c48..0c92af3cd 100755 --- a/hack/install.sh +++ b/hack/install.sh @@ -108,7 +108,7 @@ case "$lsb_dist" in fi ( set -x - $sh_c "$curl ${url}gpg | apt-key add -" + $sh_c "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9" $sh_c "echo deb ${url}ubuntu docker main > /etc/apt/sources.list.d/docker.list" $sh_c 'sleep 3; apt-get update; apt-get install -y -q lxc-docker' ) diff --git a/hack/release.sh b/hack/release.sh index d1278a4c3..8256faa2d 100755 --- a/hack/release.sh +++ b/hack/release.sh @@ -245,7 +245,7 @@ EOF # Add the repository to your APT sources echo deb $(s3_url)/ubuntu docker main > /etc/apt/sources.list.d/docker.list # Then import the repository key -curl $(s3_url)/gpg | apt-key add - +apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 # Install docker apt-get update ; apt-get install -y lxc-docker From 94c803e9f0e725e6a52f71ffaa88d05137b62771 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Sun, 5 Jan 2014 14:50:57 +0000 Subject: [PATCH 05/32] Fixes key installation for other target urls in hack/install.sh Docker-DCO-1.0-Signed-off-by: Jonas Pfenniger (github: zimbatm) --- hack/install.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hack/install.sh b/hack/install.sh index 0c92af3cd..1f37018a7 100755 --- a/hack/install.sh +++ b/hack/install.sh @@ -108,7 +108,11 @@ case "$lsb_dist" in fi ( set -x - $sh_c "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9" + if [ "https://get.docker.io/" = "$url" ]; then + $sh_c "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9" + else + $sh_c "$curl ${url}gpg | apt-key add -" + fi $sh_c "echo deb ${url}ubuntu docker main > /etc/apt/sources.list.d/docker.list" $sh_c 'sleep 3; apt-get update; apt-get install -y -q lxc-docker' ) From b57051a7247c61fdd9dc06710cd61521dca91940 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 3 Jan 2014 17:52:18 -0700 Subject: [PATCH 06/32] Update release checklist with more information, more commands, and more correct flow (test, upload to test.docker.io, test, upload to get.docker.io, THEN tag&merge) Docker-DCO-1.0-Signed-off-by: Andrew Page (github: tianon) --- hack/RELEASE-CHECKLIST.md | 167 +++++++++++++++++++++++++++----------- 1 file changed, 119 insertions(+), 48 deletions(-) diff --git a/hack/RELEASE-CHECKLIST.md b/hack/RELEASE-CHECKLIST.md index 8723d3c56..41aca4775 100644 --- a/hack/RELEASE-CHECKLIST.md +++ b/hack/RELEASE-CHECKLIST.md @@ -1,3 +1,4 @@ +# Release Checklist ## A maintainer's guide to releasing Docker So you're in charge of a Docker release? Cool. Here's what to do. @@ -8,9 +9,10 @@ to keep it up-to-date. ### 1. Pull from master and create a release branch ```bash -export VERSION=vXXX +export VERSION=vX.Y.Z git checkout release -git pull +git fetch +git reset --hard origin/release git checkout -b bump_$VERSION git merge origin/master ``` @@ -20,16 +22,13 @@ git merge origin/master You can run this command for reference: ```bash -LAST_VERSION=$(git tag | grep -E "v[0-9\.]+$" | sort -nr | head -n 1) -git log $LAST_VERSION..HEAD +LAST_VERSION=$(git tag | grep -E 'v[0-9\.]+$' | sort -nr | head -n 1) +git log --stat $LAST_VERSION..HEAD ``` -Each change should be formatted as ```BULLET CATEGORY: DESCRIPTION``` +Each change should be listed under a category heading formatted as `#### CATEGORY`. -* BULLET is either ```-```, ```+``` or ```*```, to indicate a bugfix, - new feature or upgrade, respectively. - -* CATEGORY should describe which part of the project is affected. +`CATEGORY` should describe which part of the project is affected. Valid categories are: * Builder * Documentation @@ -37,19 +36,34 @@ Each change should be formatted as ```BULLET CATEGORY: DESCRIPTION``` * Packaging * Remote API * Runtime + * Other (please use this category sparingly) -* DESCRIPTION: a concise description of the change that is relevant to the - end-user, using the present tense. Changes should be described in terms - of how they affect the user, for example "new feature X which allows Y", - "fixed bug which caused X", "increased performance of Y". +Each change should be formatted as `BULLET DESCRIPTION`, given: + +* BULLET: either `-`, `+` or `*`, to indicate a bugfix, new feature or + upgrade, respectively. + +* DESCRIPTION: a concise description of the change that is relevant to the + end-user, using the present tense. Changes should be described in terms + of how they affect the user, for example "Add new feature X which allows Y", + "Fix bug which caused X", "Increase performance of Y". EXAMPLES: -``` -+ Builder: 'docker build -t FOO' applies the tag FOO to the newly built - container. -* Runtime: improve detection of kernel version -- Remote API: fix a bug in the optional unix socket transport +```markdown +## 0.3.6 (1995-12-25) + +#### Builder + ++ 'docker build -t FOO .' applies the tag FOO to the newly built container + +#### Remote API + +- Fix a bug in the optional unix socket transport + +#### Runtime + +* Improve detection of kernel version ``` ### 3. Change the contents of the VERSION file @@ -61,14 +75,14 @@ echo ${VERSION#v} > VERSION ### 4. Run all tests ```bash -docker run -privileged docker hack/make.sh test +make test ``` ### 5. Test the docs Make sure that your tree includes documentation for any modified or new features, syntax or semantic changes. Instructions for building -the docs are in ``docs/README.md`` +the docs are in `docs/README.md`. ### 6. Commit and create a pull request to the "release" branch @@ -76,44 +90,32 @@ the docs are in ``docs/README.md`` git add VERSION CHANGELOG.md git commit -m "Bump version to $VERSION" git push origin bump_$VERSION +echo "https://github.com/dotcloud/docker/compare/release...bump_$VERSION" ``` +That last command will give you the proper link to visit to ensure that you +open the PR against the "release" branch instead of accidentally against +"master" (like so many brave souls before you already have). + ### 7. Get 2 other maintainers to validate the pull request -### 8. Apply tag - -```bash -git tag -a $VERSION -m $VERSION bump_$VERSION -git push origin $VERSION -``` - -Merging the pull request to the release branch will automatically -update the documentation on the "latest" revision of the docs. You -should see the updated docs 5-10 minutes after the merge. The docs -will appear on http://docs.docker.io/. For more information about -documentation releases, see ``docs/README.md`` - -### 9. Go to github to merge the bump_$VERSION into release - -Don't forget to push that pretty blue button to delete the leftover -branch afterwards! - -### 10. Publish binaries +### 8. Publish binaries To run this you will need access to the release credentials. Get them from [the infrastructure maintainers]( https://github.com/dotcloud/docker/blob/master/hack/infrastructure/MAINTAINERS). ```bash -git checkout release -git fetch -git reset --hard origin/release docker build -t docker . -docker run \ +export AWS_S3_BUCKET="test.docker.io" +export AWS_ACCESS_KEY="$(cat ~/.aws/access_key)" +export AWS_SECRET_KEY="$(cat ~/.aws/secret_key)" +export GPG_PASSPHRASE=supersecretsesame +docker run \ -e AWS_S3_BUCKET=test.docker.io \ - -e AWS_ACCESS_KEY=$(cat ~/.aws/access_key) \ - -e AWS_SECRET_KEY=$(cat ~/.aws/secret_key) \ - -e GPG_PASSPHRASE=supersecretsesame \ + -e AWS_ACCESS_KEY \ + -e AWS_SECRET_KEY \ + -e GPG_PASSPHRASE \ -i -t -privileged \ docker \ hack/release.sh @@ -121,9 +123,78 @@ docker run \ It will run the test suite one more time, build the binaries and packages, and upload to the specified bucket (you should use test.docker.io for -general testing, and once everything is fine, switch to get.docker.io). +general testing, and once everything is fine, switch to get.docker.io as +noted below). -### 11. Rejoice and Evangelize! +After the binaries and packages are uploaded to test.docker.io, make sure +they get tested in both Ubuntu and Debian for any obvious installation +issues or runtime issues. + +Announcing on IRC in both `#docker` and `#docker-dev` is a great way to get +help testing! An easy way to get some useful links for sharing: + +```bash +echo "Ubuntu/Debian install script: curl -sLS https://test.docker.io/ | sh" +echo "Linux 64bit binary: https://test.docker.io/builds/Linux/x86_64/docker-${VERSION#v}" +echo "Darwin/OSX 64bit client binary: https://test.docker.io/builds/Darwin/x86_64/docker-${VERSION#v}" +echo "Darwin/OSX 32bit client binary: https://test.docker.io/builds/Darwin/i386/docker-${VERSION#v}" +echo "Linux 64bit tgz: https://test.docker.io/builds/Linux/x86_64/docker-${VERSION#v}.tgz" +``` + +Once they're tested and reasonably believed to be working, run against +get.docker.io: + +```bash +docker run \ + -e AWS_S3_BUCKET=get.docker.io \ + -e AWS_ACCESS_KEY \ + -e AWS_SECRET_KEY \ + -e GPG_PASSPHRASE \ + -i -t -privileged \ + docker \ + hack/release.sh +``` + +### 9. Apply tag + +```bash +git tag -a $VERSION -m $VERSION bump_$VERSION +git push origin $VERSION +``` + +It's very important that we don't make the tag until after the official +release is uploaded to get.docker.io! + +### 10. Go to github to merge the `bump_$VERSION` into release + +Merging the pull request to the release branch will automatically +update the documentation on the "latest" revision of the docs. You +should see the updated docs 5-10 minutes after the merge. The docs +will appear on http://docs.docker.io/. For more information about +documentation releases, see `docs/README.md`. + +Don't forget to push that pretty blue button to delete the leftover +branch afterwards! + +### 11. Create a new pull request to merge release back into master + +```bash +git checkout master +git fetch +git reset --hard origin/master +git merge origin/release +git checkout -b merge_release_$VERSION +echo ${VERSION#v}-dev > VERSION +git add VERSION +git commit -m "Change version to $(cat VERSION)" +git push origin merge_release_$VERSION +echo "https://github.com/dotcloud/docker/compare/master...merge_release_$VERSION" +``` + +Again, get two maintainers to validate, then merge, then push that pretty +blue button to delete your branch. + +### 12. Rejoice and Evangelize! Congratulations! You're done. From a95712899e33f267a3061fa94d05189e7c371eaa Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 7 Jan 2014 18:38:07 -0700 Subject: [PATCH 07/32] Update Makefile to use "docker:GIT_BRANCH" as the generated image name for increased versatility ... and other minor Makefile improvements :) Docker-DCO-1.0-Signed-off-by: Andrew Page (github: tianon) --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 86b2a0207..d5253d86c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ .PHONY: all binary build cross default docs shell test -DOCKER_RUN_DOCKER := docker run -rm -i -t -privileged -e TESTFLAGS -v $(CURDIR)/bundles:/go/src/github.com/dotcloud/docker/bundles docker +GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD) +DOCKER_IMAGE := docker:$(GIT_BRANCH) +DOCKER_DOCS_IMAGE := docker-docs:$(GIT_BRANCH) +DOCKER_RUN_DOCKER := docker run -rm -i -t -privileged -e TESTFLAGS -v $(CURDIR)/bundles:/go/src/github.com/dotcloud/docker/bundles "$(DOCKER_IMAGE)" default: binary @@ -14,7 +17,8 @@ cross: build $(DOCKER_RUN_DOCKER) hack/make.sh binary cross docs: - docker build -t docker-docs docs && docker run -p 8000:8000 docker-docs + docker build -rm -t "$(DOCKER_DOCS_IMAGE)" docs + docker run -rm -i -t -p 8000:8000 "$(DOCKER_DOCS_IMAGE)" test: build $(DOCKER_RUN_DOCKER) hack/make.sh test test-integration @@ -23,7 +27,7 @@ shell: build $(DOCKER_RUN_DOCKER) bash build: bundles - docker build -t docker . + docker build -rm -t "$(DOCKER_IMAGE)" . bundles: mkdir bundles From 1137ecf7d1301e7f743978e02d874093bd68dacb Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Tue, 7 Jan 2014 17:46:04 -0800 Subject: [PATCH 08/32] Disable compression for build. More space usage but much faster upload Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes (github: creack) --- buildfile.go | 3 ++- utils/tarsum.go | 44 +++++++++++++++++++++++++++++++++----------- 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/buildfile.go b/buildfile.go index 09b1f8073..4864fe906 100644 --- a/buildfile.go +++ b/buildfile.go @@ -594,11 +594,12 @@ func (b *buildFile) Build(context io.Reader) (string, error) { if err != nil { return "", err } - b.context = &utils.TarSum{Reader: context} + b.context = &utils.TarSum{Reader: context, DisableCompression: true} if err := archive.Untar(b.context, tmpdirPath, nil); err != nil { return "", err } defer os.RemoveAll(tmpdirPath) + b.contextPath = tmpdirPath filename := path.Join(tmpdirPath, "Dockerfile") if _, err := os.Stat(filename); os.IsNotExist(err) { diff --git a/utils/tarsum.go b/utils/tarsum.go index 7de3dbe5b..786196b6b 100644 --- a/utils/tarsum.go +++ b/utils/tarsum.go @@ -15,16 +15,34 @@ import ( type TarSum struct { io.Reader - tarR *tar.Reader - tarW *tar.Writer - gz *gzip.Writer - bufTar *bytes.Buffer - bufGz *bytes.Buffer - h hash.Hash - sums map[string]string - currentFile string - finished bool - first bool + tarR *tar.Reader + tarW *tar.Writer + gz writeCloseFlusher + bufTar *bytes.Buffer + bufGz *bytes.Buffer + h hash.Hash + sums map[string]string + currentFile string + finished bool + first bool + DisableCompression bool +} + +type writeCloseFlusher interface { + io.WriteCloser + Flush() error +} + +type nopCloseFlusher struct { + io.Writer +} + +func (n *nopCloseFlusher) Close() error { + return nil +} + +func (n *nopCloseFlusher) Flush() error { + return nil } func (ts *TarSum) encodeHeader(h *tar.Header) error { @@ -57,7 +75,11 @@ func (ts *TarSum) Read(buf []byte) (int, error) { ts.bufGz = bytes.NewBuffer([]byte{}) ts.tarR = tar.NewReader(ts.Reader) ts.tarW = tar.NewWriter(ts.bufTar) - ts.gz = gzip.NewWriter(ts.bufGz) + if !ts.DisableCompression { + ts.gz = gzip.NewWriter(ts.bufGz) + } else { + ts.gz = &nopCloseFlusher{Writer: ts.bufGz} + } ts.h = sha256.New() ts.h.Reset() ts.first = true From d7f26c93d9f813317e88fb6565c6eb0ca835a480 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Tue, 7 Jan 2014 18:41:06 -0800 Subject: [PATCH 09/32] Change version to v0.7.4-dev Docker-DCO-1.0-Signed-off-by: Michael Crosby (github: crosbymichael) --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 0a1ffad4b..1ebd2fb6f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.7.4 +0.7.4-dev From e525ad3f9be05bfab388896ae559411650429553 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 7 Jan 2014 22:15:53 -0700 Subject: [PATCH 10/32] Fix a few miscellaneous typos (Unkown -> Unknown, Recieve -> Receive) Docker-DCO-1.0-Signed-off-by: Andrew Page (github: tianon) --- container.go | 2 +- contrib/host-integration/manager.go | 2 +- pkg/netlink/netlink_linux.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/container.go b/container.go index 532a69783..95f1fb99d 100644 --- a/container.go +++ b/container.go @@ -120,7 +120,7 @@ type BindMap struct { } var ( - ErrContainerStart = errors.New("The container failed to start. Unkown error") + ErrContainerStart = errors.New("The container failed to start. Unknown error") ErrContainerStartTimeout = errors.New("The container failed to start due to timed out.") ErrInvalidWorikingDirectory = errors.New("The working directory is invalid. It needs to be an absolute path.") ErrConflictAttachDetach = errors.New("Conflicting options: -a and -d") diff --git a/contrib/host-integration/manager.go b/contrib/host-integration/manager.go index 98ff90aa1..6742ee4d7 100644 --- a/contrib/host-integration/manager.go +++ b/contrib/host-integration/manager.go @@ -56,7 +56,7 @@ func main() { // Check that the requested process manager is supported if _, exists := templates[*kind]; !exists { - panic("Unkown script template") + panic("Unknown script template") } // Load the requested template diff --git a/pkg/netlink/netlink_linux.go b/pkg/netlink/netlink_linux.go index 4417f5249..9a937d121 100644 --- a/pkg/netlink/netlink_linux.go +++ b/pkg/netlink/netlink_linux.go @@ -234,7 +234,7 @@ func (s *NetlinkSocket) Send(request *NetlinkRequest) error { return nil } -func (s *NetlinkSocket) Recieve() ([]syscall.NetlinkMessage, error) { +func (s *NetlinkSocket) Receive() ([]syscall.NetlinkMessage, error) { rb := make([]byte, syscall.Getpagesize()) nr, _, err := syscall.Recvfrom(s.fd, rb, 0) if err != nil { @@ -269,7 +269,7 @@ func (s *NetlinkSocket) HandleAck(seq uint32) error { done: for { - msgs, err := s.Recieve() + msgs, err := s.Receive() if err != nil { return err } @@ -500,7 +500,7 @@ func NetworkGetRoutes() ([]*net.IPNet, error) { done: for { - msgs, err := s.Recieve() + msgs, err := s.Receive() if err != nil { return nil, err } From a3ee36b7474c70afdd12fa2210821cb080bc0a07 Mon Sep 17 00:00:00 2001 From: Johan Euphrosine Date: Wed, 8 Jan 2014 00:11:06 -0800 Subject: [PATCH 11/32] google-compute-engine: fix typos --- docs/sources/installation/google.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/installation/google.rst b/docs/sources/installation/google.rst index 38aab019d..62af581fe 100644 --- a/docs/sources/installation/google.rst +++ b/docs/sources/installation/google.rst @@ -62,7 +62,7 @@ .. code-block:: bash - docker-playground:~$ echo "DOCKER_OPTS="$DOCKER_OPTS -mtu 1460" | sudo tee -a /etc/defaults/docker + docker-playground:~$ echo 'DOCKER_OPTS="$DOCKER_OPTS -mtu 1460"' | sudo tee -a /etc/default/docker docker-playground:~$ sudo service docker restart 8. Start a new container: From 10b794b3328a8b8d8bcc094710cc3b59df500253 Mon Sep 17 00:00:00 2001 From: Sjoerd Langkemper Date: Tue, 7 Jan 2014 09:15:04 +0100 Subject: [PATCH 12/32] Revert "Make sure the cache lookup returns always the same result" This reverts commit 1d4b7d8fa1af95ce83f263a49ed24e686fa7cb62. Docker-DCO-1.0-Signed-off-by: Sjoerd Langkemper (github: Sjord) --- server.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/server.go b/server.go index 2405380ea..67d5266a3 100644 --- a/server.go +++ b/server.go @@ -22,7 +22,6 @@ import ( "path" "path/filepath" "runtime" - "sort" "strconv" "strings" "sync" @@ -1697,13 +1696,16 @@ func (srv *Server) ImageGetCached(imgID string, config *Config) (*Image, error) } // Store the tree in a map of map (map[parentId][childId]) - imageMap := make(map[string][]string) + imageMap := make(map[string]map[string]struct{}) for _, img := range images { - imageMap[img.Parent] = append(imageMap[img.Parent], img.ID) + if _, exists := imageMap[img.Parent]; !exists { + imageMap[img.Parent] = make(map[string]struct{}) + } + imageMap[img.Parent][img.ID] = struct{}{} } - sort.Strings(imageMap[imgID]) + // Loop on the children of the given image and check the config - for _, elem := range imageMap[imgID] { + for elem := range imageMap[imgID] { img, err := srv.runtime.graph.Get(elem) if err != nil { return nil, err From 46c8b11f245204e9f6e1ae764b52911c327be1a9 Mon Sep 17 00:00:00 2001 From: Sjoerd Langkemper Date: Wed, 1 Jan 2014 17:38:25 +0100 Subject: [PATCH 13/32] Fix issue #3375 - Return most recent image from the cache ImageGetCached searches for an image from the cache. Instead of returning the first image it finds, it should return the most recently created image. When a build with --no-cache then adds a new image with the same parameters, it is used instead of the old, existing image. Docker-DCO-1.0-Signed-off-by: Sjoerd Langkemper (github: Sjord) --- server.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server.go b/server.go index 67d5266a3..3ad5122d2 100644 --- a/server.go +++ b/server.go @@ -1705,16 +1705,19 @@ func (srv *Server) ImageGetCached(imgID string, config *Config) (*Image, error) } // Loop on the children of the given image and check the config + var match *Image for elem := range imageMap[imgID] { img, err := srv.runtime.graph.Get(elem) if err != nil { return nil, err } if CompareConfig(&img.ContainerConfig, config) { - return img, nil + if match == nil || match.Created.Before(img.Created) { + match = img + } } } - return nil, nil + return match, nil } func (srv *Server) RegisterLinks(container *Container, hostConfig *HostConfig) error { From 53a01aebd61e8db34c9106f5b2c5fdad6909caee Mon Sep 17 00:00:00 2001 From: Manuel Woelker Date: Wed, 8 Jan 2014 09:14:00 +0100 Subject: [PATCH 14/32] Fix for #3345: Add Content-Type Header "application/json" to GET /version and /info responses in remote API Docker-DCO-1.0-Signed-off-by: Manuel Woelker (github: manuel-woelker) --- api.go | 2 ++ integration/api_test.go | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/api.go b/api.go index 1128c7a2b..972abbf71 100644 --- a/api.go +++ b/api.go @@ -140,6 +140,7 @@ func postAuth(srv *Server, version float64, w http.ResponseWriter, r *http.Reque } func getVersion(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error { + w.Header().Set("Content-Type", "application/json") srv.Eng.ServeHTTP(w, r) return nil } @@ -216,6 +217,7 @@ func getImagesViz(srv *Server, version float64, w http.ResponseWriter, r *http.R } func getInfo(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error { + w.Header().Set("Content-Type", "application/json") srv.Eng.ServeHTTP(w, r) return nil } diff --git a/integration/api_test.go b/integration/api_test.go index 6cd2e11f3..ff42afac5 100644 --- a/integration/api_test.go +++ b/integration/api_test.go @@ -49,6 +49,10 @@ func TestGetVersion(t *testing.T) { if result := v.Get("Version"); result != expected { t.Errorf("Expected version %s, %s found", expected, result) } + expected = "application/json" + if result := r.HeaderMap.Get("Content-Type"); result != expected { + t.Errorf("Expected Content-Type %s, %s found", expected, result) + } } func TestGetInfo(t *testing.T) { @@ -84,6 +88,10 @@ func TestGetInfo(t *testing.T) { if images := i.GetInt("Images"); images != len(initialImages) { t.Errorf("Expected images: %d, %d found", len(initialImages), images) } + expected := "application/json" + if result := r.HeaderMap.Get("Content-Type"); result != expected { + t.Errorf("Expected Content-Type %s, %s found", expected, result) + } } func TestGetEvents(t *testing.T) { From c9cebf3a73efa4827d051ddd69a8590b03419f8a Mon Sep 17 00:00:00 2001 From: Gert van Valkenhoef Date: Wed, 8 Jan 2014 10:58:55 +0100 Subject: [PATCH 15/32] Hello World: fix detach behavior The hello world example relies on being able to exit the container attachment using Control-C without stopping it. According to this thread (and my own experience), this doesn't work anymore: https://groups.google.com/forum/#!msg/docker-user/nWXAnyLP9-M/kbv-FZpF4rUJ Added -sig-proxy=false to the attach command. --- docs/sources/examples/hello_world.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/sources/examples/hello_world.rst b/docs/sources/examples/hello_world.rst index c25070fcd..62f515244 100644 --- a/docs/sources/examples/hello_world.rst +++ b/docs/sources/examples/hello_world.rst @@ -125,12 +125,14 @@ Check the logs make sure it is working correctly. .. code-block:: bash - sudo docker attach $CONTAINER_ID + sudo docker attach -sig-proxy=false $CONTAINER_ID Attach to the container to see the results in real-time. - **"docker attach**" This will allow us to attach to a background process to see what is going on. +- "-sig-proxy=false" Do not forward signals to the container; allows + us to exit the attachment using Control-C without stopping the container. - **$CONTAINER_ID** The Id of the container we want to attach too. Exit from the container attachment by pressing Control-C. From 8298a200ce3bbab7d00ab73e8bac34643c7a1fc5 Mon Sep 17 00:00:00 2001 From: Gert van Valkenhoef Date: Wed, 8 Jan 2014 18:45:06 +0100 Subject: [PATCH 16/32] Add the customary bold --- docs/sources/examples/hello_world.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/examples/hello_world.rst b/docs/sources/examples/hello_world.rst index 62f515244..aeb95881d 100644 --- a/docs/sources/examples/hello_world.rst +++ b/docs/sources/examples/hello_world.rst @@ -131,7 +131,7 @@ Attach to the container to see the results in real-time. - **"docker attach**" This will allow us to attach to a background process to see what is going on. -- "-sig-proxy=false" Do not forward signals to the container; allows +- **"-sig-proxy=false"** Do not forward signals to the container; allows us to exit the attachment using Control-C without stopping the container. - **$CONTAINER_ID** The Id of the container we want to attach too. From c6350bcc2411dfc5039976239e143f6b9da64444 Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Tue, 7 Jan 2014 17:46:04 -0800 Subject: [PATCH 17/32] Disable compression for build. More space usage but much faster upload Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes (github: creack) --- buildfile.go | 3 ++- utils/tarsum.go | 44 +++++++++++++++++++++++++++++++++----------- 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/buildfile.go b/buildfile.go index ef4b95c06..dc8602622 100644 --- a/buildfile.go +++ b/buildfile.go @@ -604,11 +604,12 @@ func (b *buildFile) Build(context io.Reader) (string, error) { if err != nil { return "", err } - b.context = &utils.TarSum{Reader: context} + b.context = &utils.TarSum{Reader: context, DisableCompression: true} if err := archive.Untar(b.context, tmpdirPath, nil); err != nil { return "", err } defer os.RemoveAll(tmpdirPath) + b.contextPath = tmpdirPath filename := path.Join(tmpdirPath, "Dockerfile") if _, err := os.Stat(filename); os.IsNotExist(err) { diff --git a/utils/tarsum.go b/utils/tarsum.go index 7de3dbe5b..786196b6b 100644 --- a/utils/tarsum.go +++ b/utils/tarsum.go @@ -15,16 +15,34 @@ import ( type TarSum struct { io.Reader - tarR *tar.Reader - tarW *tar.Writer - gz *gzip.Writer - bufTar *bytes.Buffer - bufGz *bytes.Buffer - h hash.Hash - sums map[string]string - currentFile string - finished bool - first bool + tarR *tar.Reader + tarW *tar.Writer + gz writeCloseFlusher + bufTar *bytes.Buffer + bufGz *bytes.Buffer + h hash.Hash + sums map[string]string + currentFile string + finished bool + first bool + DisableCompression bool +} + +type writeCloseFlusher interface { + io.WriteCloser + Flush() error +} + +type nopCloseFlusher struct { + io.Writer +} + +func (n *nopCloseFlusher) Close() error { + return nil +} + +func (n *nopCloseFlusher) Flush() error { + return nil } func (ts *TarSum) encodeHeader(h *tar.Header) error { @@ -57,7 +75,11 @@ func (ts *TarSum) Read(buf []byte) (int, error) { ts.bufGz = bytes.NewBuffer([]byte{}) ts.tarR = tar.NewReader(ts.Reader) ts.tarW = tar.NewWriter(ts.bufTar) - ts.gz = gzip.NewWriter(ts.bufGz) + if !ts.DisableCompression { + ts.gz = gzip.NewWriter(ts.bufGz) + } else { + ts.gz = &nopCloseFlusher{Writer: ts.bufGz} + } ts.h = sha256.New() ts.h.Reset() ts.first = true From 93ff70a3e70e14762314f04e2b9f61c8710d5353 Mon Sep 17 00:00:00 2001 From: Frank Macreery Date: Mon, 6 Jan 2014 22:42:57 -0500 Subject: [PATCH 18/32] Potential fix for ADD . Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes (github: creack) --- buildfile.go | 4 +++- integration/buildfile_test.go | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/buildfile.go b/buildfile.go index dc8602622..d28d499bf 100644 --- a/buildfile.go +++ b/buildfile.go @@ -421,7 +421,9 @@ func (b *buildFile) CmdAdd(args string) error { } else if fi.IsDir() { var subfiles []string for file, sum := range sums { - if strings.HasPrefix(file, origPath) { + absFile := path.Join(b.contextPath, file) + absOrigPath := path.Join(b.contextPath, origPath) + if strings.HasPrefix(absFile, absOrigPath) { subfiles = append(subfiles, sum) } } diff --git a/integration/buildfile_test.go b/integration/buildfile_test.go index ef5177739..5dd403274 100644 --- a/integration/buildfile_test.go +++ b/integration/buildfile_test.go @@ -592,6 +592,26 @@ func TestBuildADDLocalFileWithoutCache(t *testing.T) { checkCacheBehavior(t, template, false) } +func TestBuildADDCurrentDirectoryWithCache(t *testing.T) { + template := testContextTemplate{` + from {IMAGE} + maintainer dockerio + add . /usr/lib/bla + `, + nil, nil} + checkCacheBehavior(t, template, true) +} + +func TestBuildADDCurrentDirectoryWithoutCache(t *testing.T) { + template := testContextTemplate{` + from {IMAGE} + maintainer dockerio + add . /usr/lib/bla + `, + nil, nil} + checkCacheBehavior(t, template, false) +} + func TestBuildADDRemoteFileWithCache(t *testing.T) { template := testContextTemplate{` from {IMAGE} From e24e9c09f8533b662d1d829123431540bb95ea51 Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Wed, 8 Jan 2014 12:16:23 -0800 Subject: [PATCH 19/32] Make sure file are cached correctly during build Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes (github: creack) --- buildfile.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/buildfile.go b/buildfile.go index d28d499bf..2243962f9 100644 --- a/buildfile.go +++ b/buildfile.go @@ -408,14 +408,6 @@ func (b *buildFile) CmdAdd(args string) error { sums = b.context.GetSums() ) - // Has tarsum strips the '.' and './', we put it back for comparaison. - for file, sum := range sums { - if len(file) == 0 || file[0] != '.' && file[0] != '/' { - delete(sums, file) - sums["./"+file] = sum - } - } - if fi, err := os.Stat(path.Join(b.contextPath, origPath)); err != nil { return err } else if fi.IsDir() { @@ -432,7 +424,13 @@ func (b *buildFile) CmdAdd(args string) error { hasher.Write([]byte(strings.Join(subfiles, ","))) hash = "dir:" + hex.EncodeToString(hasher.Sum(nil)) } else { - hash = "file:" + sums[origPath] + if origPath[0] == '/' && len(origPath) > 1 { + origPath = origPath[1:] + } + origPath = strings.TrimPrefix(origPath, "./") + if h, ok := sums[origPath]; ok { + hash = "file:" + h + } } b.config.Cmd = []string{"/bin/sh", "-c", fmt.Sprintf("#(nop) ADD %s in %s", hash, dest)} hit, err := b.probeCache() From 762a0cc4723917b4e6ca3731356e43c5e9a13f5f Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Wed, 8 Jan 2014 14:20:30 -0800 Subject: [PATCH 20/32] Cleanup utils.Download Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes (github: creack) --- utils/utils.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/utils/utils.go b/utils/utils.go index d5dbf35f0..4dfadb793 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -6,7 +6,6 @@ import ( "crypto/sha256" "encoding/hex" "encoding/json" - "errors" "fmt" "index/suffixarray" "io" @@ -46,14 +45,12 @@ func Go(f func() error) chan error { } // Request a given URL and return an io.Reader -func Download(url string) (*http.Response, error) { - var resp *http.Response - var err error +func Download(url string) (resp *http.Response, err error) { if resp, err = http.Get(url); err != nil { return nil, err } if resp.StatusCode >= 400 { - return nil, errors.New("Got HTTP status code >= 400: " + resp.Status) + return nil, fmt.Errorf("Got HTTP status code >= 400: %s", resp.Status) } return resp, nil } From 0fd9c98de3fc2c8fb1da6dc3ef277b3325106b26 Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Wed, 8 Jan 2014 14:20:50 -0800 Subject: [PATCH 21/32] Make sure the remote ADD are cached properly Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes (github: creack) --- buildfile.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/buildfile.go b/buildfile.go index 2243962f9..de03e5879 100644 --- a/buildfile.go +++ b/buildfile.go @@ -353,8 +353,9 @@ func (b *buildFile) CmdAdd(args string) error { // FIXME: do we really need this? var ( - origPath = orig - destPath = dest + origPath = orig + destPath = dest + remoteHash string ) if utils.IsURL(orig) { @@ -373,11 +374,20 @@ func (b *buildFile) CmdAdd(args string) error { } defer os.RemoveAll(tmpDirName) if _, err = io.Copy(tmpFile, resp.Body); err != nil { + tmpFile.Close() return err } origPath = path.Join(filepath.Base(tmpDirName), filepath.Base(tmpFileName)) tmpFile.Close() + // Process the checksum + r, err := archive.Tar(tmpFileName, archive.Uncompressed) + if err != nil { + return err + } + tarSum := utils.TarSum{Reader: r, DisableCompression: true} + remoteHash = tarSum.Sum(nil) + // If the destination is a directory, figure out the filename. if strings.HasSuffix(dest, "/") { u, err := url.Parse(orig) @@ -408,7 +418,9 @@ func (b *buildFile) CmdAdd(args string) error { sums = b.context.GetSums() ) - if fi, err := os.Stat(path.Join(b.contextPath, origPath)); err != nil { + if remoteHash != "" { + hash = remoteHash + } else if fi, err := os.Stat(path.Join(b.contextPath, origPath)); err != nil { return err } else if fi.IsDir() { var subfiles []string From 5530cc29b257c404b0f76d4b0cf620b877b0fae2 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Wed, 8 Jan 2014 14:50:52 -0800 Subject: [PATCH 22/32] update REMOTE_TODO.md Docker-DCO-1.0-Signed-off-by: Victor Vieux (github: vieux) --- REMOTE_TODO.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/REMOTE_TODO.md b/REMOTE_TODO.md index 8caddc68b..5bc8d0bf7 100644 --- a/REMOTE_TODO.md +++ b/REMOTE_TODO.md @@ -8,15 +8,15 @@ ok "/version": getVersion, 1 TODO "/images/viz": getImagesViz, 0 yes TODO "/images/search": getImagesSearch, N #3490 "/images/{name:.*}/get": getImagesGet, 0 -TODO "/images/{name:.*}/history": getImagesHistory, 1 +TODO "/images/{name:.*}/history": getImagesHistory, N TODO "/images/{name:.*}/json": getImagesByName, 1 TODO "/containers/ps": getContainersJSON, N TODO "/containers/json": getContainersJSON, 1 ok "/containers/{name:.*}/export": getContainersExport, 0 -TODO "/containers/{name:.*}/changes": getContainersChanges, 1 +TODO "/containers/{name:.*}/changes": getContainersChanges, N TODO "/containers/{name:.*}/json": getContainersByName, 1 TODO "/containers/{name:.*}/top": getContainersTop, N -TODO "/containers/{name:.*}/attach/ws": wsContainersAttach, 0 yes +#3512 "/containers/{name:.*}/attach/ws": wsContainersAttach, 0 yes **POST** TODO "/auth": postAuth, 0 yes @@ -34,7 +34,7 @@ ok "/containers/{name:.*}/start": postContainersStart, 0 ok "/containers/{name:.*}/stop": postContainersStop, 0 ok "/containers/{name:.*}/wait": postContainersWait, 0 ok "/containers/{name:.*}/resize": postContainersResize, 0 -TODO "/containers/{name:.*}/attach": postContainersAttach, 0 yes +#3512 "/containers/{name:.*}/attach": postContainersAttach, 0 yes TODO "/containers/{name:.*}/copy": postContainersCopy, 0 yes **DELETE** From 98193a397ef933a449f70c7661bff037bf98eb99 Mon Sep 17 00:00:00 2001 From: Cory Forsyth Date: Wed, 8 Jan 2014 16:18:37 -0500 Subject: [PATCH 23/32] Fix misspelling of Richard Feynman's last name Docker-DCO-1.0-Signed-off-by: Cory Forsyth (github: bantic) --- pkg/namesgenerator/names-generator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/namesgenerator/names-generator.go b/pkg/namesgenerator/names-generator.go index 3c8097a92..b37c22d38 100644 --- a/pkg/namesgenerator/names-generator.go +++ b/pkg/namesgenerator/names-generator.go @@ -40,7 +40,7 @@ var ( // Niels Bohr is the father of quantum theory. http://en.wikipedia.org/wiki/Niels_Bohr. // Nikola Tesla invented the AC electric system and every gaget ever used by a James Bond villain. http://en.wikipedia.org/wiki/Nikola_Tesla // Pierre de Fermat pioneered several aspects of modern mathematics. http://en.wikipedia.org/wiki/Pierre_de_Fermat - // Richard Feynmann was a key contributor to quantum mechanics and particle physics. http://en.wikipedia.org/wiki/Richard_Feynman + // Richard Feynman was a key contributor to quantum mechanics and particle physics. http://en.wikipedia.org/wiki/Richard_Feynman // Rob Pike was a key contributor to Unix, Plan 9, the X graphic system, utf-8, and the Go programming language. http://en.wikipedia.org/wiki/Rob_Pike // Stephen Hawking pioneered the field of cosmology by combining general relativity and quantum mechanics. http://en.wikipedia.org/wiki/Stephen_Hawking // Steve Wozniak invented the Apple I and Apple II. http://en.wikipedia.org/wiki/Steve_Wozniak @@ -49,7 +49,7 @@ var ( // http://en.wikipedia.org/wiki/John_Bardeen // http://en.wikipedia.org/wiki/Walter_Houser_Brattain // http://en.wikipedia.org/wiki/William_Shockley - right = [...]string{"lovelace", "franklin", "tesla", "einstein", "bohr", "davinci", "pasteur", "nobel", "curie", "darwin", "turing", "ritchie", "torvalds", "pike", "thompson", "wozniak", "galileo", "euclide", "newton", "fermat", "archimede", "poincare", "heisenberg", "feynmann", "hawkings", "fermi", "pare", "mccarthy", "engelbart", "babbage", "albattani", "ptolemy", "bell", "wright", "lumiere", "morse", "mclean", "brown", "bardeen", "brattain", "shockley"} + right = [...]string{"lovelace", "franklin", "tesla", "einstein", "bohr", "davinci", "pasteur", "nobel", "curie", "darwin", "turing", "ritchie", "torvalds", "pike", "thompson", "wozniak", "galileo", "euclide", "newton", "fermat", "archimede", "poincare", "heisenberg", "feynman", "hawkings", "fermi", "pare", "mccarthy", "engelbart", "babbage", "albattani", "ptolemy", "bell", "wright", "lumiere", "morse", "mclean", "brown", "bardeen", "brattain", "shockley"} ) func GenerateRandomName(checker NameChecker) (string, error) { From 0354c3a95cf1f95ac9564b8e2897295e8a8613fd Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Wed, 8 Jan 2014 16:57:56 -0800 Subject: [PATCH 24/32] Do not add hostname when networking is disabled Docker-DCO-1.0-Signed-off-by: Michael Crosby (github: crosbymichael) --- container.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container.go b/container.go index 95f1fb99d..cea316ae5 100644 --- a/container.go +++ b/container.go @@ -1044,7 +1044,7 @@ ff02::2 ip6-allrouters if container.Config.Domainname != "" { hostsContent = append([]byte(fmt.Sprintf("%s\t%s.%s %s\n", IP, container.Config.Hostname, container.Config.Domainname, container.Config.Hostname)), hostsContent...) - } else { + } else if !container.Config.NetworkDisabled { hostsContent = append([]byte(fmt.Sprintf("%s\t%s\n", IP, container.Config.Hostname)), hostsContent...) } From 7a7c3d87d8040b41970b7fc89305bb18561386d3 Mon Sep 17 00:00:00 2001 From: Cory Forsyth Date: Thu, 9 Jan 2014 10:02:55 -0500 Subject: [PATCH 25/32] Fix misspelled Hawkings -> Hawking, Archimede -> Archimedes, Euclide -> Euclid Docker-DCO-1.0-Signed-off-by: Cory Forsyth (github: bantic) --- pkg/namesgenerator/names-generator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/namesgenerator/names-generator.go b/pkg/namesgenerator/names-generator.go index b37c22d38..dfece5d61 100644 --- a/pkg/namesgenerator/names-generator.go +++ b/pkg/namesgenerator/names-generator.go @@ -49,7 +49,7 @@ var ( // http://en.wikipedia.org/wiki/John_Bardeen // http://en.wikipedia.org/wiki/Walter_Houser_Brattain // http://en.wikipedia.org/wiki/William_Shockley - right = [...]string{"lovelace", "franklin", "tesla", "einstein", "bohr", "davinci", "pasteur", "nobel", "curie", "darwin", "turing", "ritchie", "torvalds", "pike", "thompson", "wozniak", "galileo", "euclide", "newton", "fermat", "archimede", "poincare", "heisenberg", "feynman", "hawkings", "fermi", "pare", "mccarthy", "engelbart", "babbage", "albattani", "ptolemy", "bell", "wright", "lumiere", "morse", "mclean", "brown", "bardeen", "brattain", "shockley"} + right = [...]string{"lovelace", "franklin", "tesla", "einstein", "bohr", "davinci", "pasteur", "nobel", "curie", "darwin", "turing", "ritchie", "torvalds", "pike", "thompson", "wozniak", "galileo", "euclid", "newton", "fermat", "archimedes", "poincare", "heisenberg", "feynman", "hawking", "fermi", "pare", "mccarthy", "engelbart", "babbage", "albattani", "ptolemy", "bell", "wright", "lumiere", "morse", "mclean", "brown", "bardeen", "brattain", "shockley"} ) func GenerateRandomName(checker NameChecker) (string, error) { From 7fb55f77250a9b52b0515a7e655ecc605ae452ca Mon Sep 17 00:00:00 2001 From: Nick Stinemates Date: Thu, 9 Jan 2014 08:35:06 -0800 Subject: [PATCH 26/32] Removed the 5th clause Removed clause which states contributions should be relicensed --- CONTRIBUTING.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 783c8273f..1c0c2c9be 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -126,7 +126,6 @@ c. The contribution was provided directly to me by some other person who represe d. I understand and agree that this Project and the contribution are publicly known and that a record of the contribution (including all personal information I submit with it, including my sign-off record) is maintained indefinitely and may be redistributed consistent with this Project or the open source license(s) involved. -e. I hereby grant to the Project, Docker, Inc and its successors; and recipients of software distributed by the Project a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, modify, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute this contribution and such modifications and derivative works consistent with this Project, the open source license indicated in the previous work or other appropriate open source license specified by the Project and approved by the Open Source Initiative(OSI) at http://www.opensource.org. ``` then you just add a line saying From 40c90796e950307804745c5a852cc64d3e53a1a9 Mon Sep 17 00:00:00 2001 From: Nick Stinemates Date: Thu, 9 Jan 2014 08:35:47 -0800 Subject: [PATCH 27/32] Fix layout --- CONTRIBUTING.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1c0c2c9be..e9fc09665 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -119,7 +119,6 @@ By making a contribution to the Docker Project ("Project"), I represent and warr a. The contribution was created in whole or in part by me and I have the right to submit the contribution on my own behalf or on behalf of a third party who has authorized me to submit this contribution to the Project; or - b. The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right and authorization to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license) that I have identified in the contribution; or c. The contribution was provided directly to me by some other person who represented and warranted (a) or (b) and I have not modified it. From 11d61ec77feb743a3eedef7d85a7a751ed09736e Mon Sep 17 00:00:00 2001 From: Nick Stinemates Date: Thu, 9 Jan 2014 08:47:03 -0800 Subject: [PATCH 28/32] Bump DCO version --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9fc09665..40982e9d6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -113,7 +113,7 @@ pass it on as an open-source patch. The rules are pretty simple: if you can certify the below: ``` -Docker Developer Grant and Certificate of Origin 1.0 +Docker Developer Grant and Certificate of Origin 1.1 By making a contribution to the Docker Project ("Project"), I represent and warrant that: @@ -129,7 +129,7 @@ d. I understand and agree that this Project and the contribution are publicly kn then you just add a line saying - Docker-DCO-1.0-Signed-off-by: Joe Smith (github: github_handle) + Docker-DCO-1.1-Signed-off-by: Joe Smith (github: github_handle) using your real name (sorry, no pseudonyms or anonymous contributions.) From a4f3cd62a3d221dcb55279cc9f0db41e7920c094 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 9 Jan 2014 09:51:45 -0700 Subject: [PATCH 29/32] Update Travis to check for new 1.1 DCO version Docker-DCO-1.1-Signed-off-by: Andrew Page (github: tianon) --- hack/travis/dco.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/travis/dco.py b/hack/travis/dco.py index cab26fedd..d80d528f9 100755 --- a/hack/travis/dco.py +++ b/hack/travis/dco.py @@ -17,7 +17,7 @@ commits = yaml.load(gitlog) if not commits: exit(0) # what? how can we have no commits? -DCO = 'Docker-DCO-1.0-Signed-off-by:' +DCO = 'Docker-DCO-1.1-Signed-off-by:' p = re.compile(r'^{0} ([^<]+) <([^<>@]+@[^<>]+)> \(github: (\S+)\)$'.format(re.escape(DCO)), re.MULTILINE|re.UNICODE) From c3f259754688d7c20cac5b8f8b998a7608f034a8 Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Thu, 9 Jan 2014 09:02:56 -0800 Subject: [PATCH 30/32] Update DCO git hook example --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c09d13aa7..b8b926ff9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -145,7 +145,7 @@ the following to your ``.git/hooks/prepare-commit-msg`` script (needs # see https://github.com/dotcloud/docker/blob/master/CONTRIBUTING.md#sign-your-work # GH_USER=$(git config --get github.user) - SOB=$(git var GIT_AUTHOR_IDENT | sed -n "s/^\(.*>\).*$/Docker-DCO-1.0-Signed-off-by: \1 \(github: $GH_USER\)/p") + SOB=$(git var GIT_AUTHOR_IDENT | sed -n "s/^\(.*>\).*$/Docker-DCO-1.1-Signed-off-by: \1 \(github: $GH_USER\)/p") grep -qs "^$SOB" "$1" || echo "\n$SOB" >> "$1" ``` From 562a23576328c1586f1be968fa15cb075267138c Mon Sep 17 00:00:00 2001 From: Paul Lietar Date: Thu, 9 Jan 2014 18:17:50 +0000 Subject: [PATCH 31/32] Don't compress the archive made from git's output. Commit 894d4a23fba made BuildFile use TarSum, which doesn't support compressed tar archives. This breaks builds from git url, which compressed it with bzip2. Instead, just pass it uncompressed. Docker-DCO-1.0-Signed-off-by: Paul Lietar (github: plietar) --- AUTHORS | 1 + api.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 1ff9b8db0..35cfc687b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -148,6 +148,7 @@ odk- Pascal Borreli Paul Bowsher Paul Hammond +Paul LiƩtar Paul Nasrat Phil Spitler Piotr Bogdan diff --git a/api.go b/api.go index 972abbf71..9fe9bc716 100644 --- a/api.go +++ b/api.go @@ -929,7 +929,7 @@ func postBuild(srv *Server, version float64, w http.ResponseWriter, r *http.Requ return fmt.Errorf("Error trying to use git: %s (%s)", err, output) } - c, err := archive.Tar(root, archive.Bzip2) + c, err := archive.Tar(root, archive.Uncompressed) if err != nil { return err } From c348c04fdfb00e013be9db15d37728e04fb94b76 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Thu, 9 Jan 2014 10:34:50 -0800 Subject: [PATCH 32/32] Bump to version v0.7.5 Docker-DCO-1.1-Signed-off-by: Michael Crosby (github: crosbymichael) --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ VERSION | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eccf52ed0..72a0a2eec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,33 @@ # Changelog +## 0.7.5 (2014-01-09) + +#### Builder + +* Disable compression for build. More space usage but a much faster upload +- Fix ADD caching for certain paths +- Do not compress archive from git build + +#### Documentation + +- Fix error in GROUP add example +* Make sure the GPG fingerprint is inline in the documentation +* Give more specific advice on setting up signing of commits for DCO + +#### Runtime + +- Fix misspelled container names +- Do not add hostname when networking is disabled +* Return most recent image from the cache by date +- Return all errors from docker wait +* Add Content-Type Header "application/json" to GET /version and /info responses + +#### Other + +* Update DCO to version 1.1 ++ Update Makefile to use "docker:GIT_BRANCH" as the generated image name +* Update Travis to check for new 1.1 DCO version + ## 0.7.4 (2014-01-07) #### Builder diff --git a/VERSION b/VERSION index 1ebd2fb6f..8bd6ba8c5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.7.4-dev +0.7.5