From 3384943cd3bc5bb9fd79ccbda9d32a582ada69b3 Mon Sep 17 00:00:00 2001
From: Daniel Mizyrycki <daniel@dotcloud.com>
Date: Thu, 13 Jun 2013 22:14:29 -0700
Subject: [PATCH 1/3] Packaging, dockerbuilder: Automate pushing docker binary
 packages

---
 Makefile                         |  2 ++
 hack/dockerbuilder/Dockerfile    |  1 -
 hack/dockerbuilder/dockerbuilder | 13 +++++++------
 hack/dockerbuilder/s3cfg         |  3 ---
 4 files changed, 9 insertions(+), 10 deletions(-)
 delete mode 100644 hack/dockerbuilder/s3cfg

diff --git a/Makefile b/Makefile
index 9527d3f750..eca409c967 100644
--- a/Makefile
+++ b/Makefile
@@ -46,6 +46,7 @@ whichrelease:
 
 release: $(BINRELEASE)
 	s3cmd -P put $(BINRELEASE) s3://get.docker.io/builds/`uname -s`/`uname -m`/docker-$(RELEASE_VERSION).tgz
+	s3cmd -P put docker-latest.tgz s3://get.docker.io/builds/`uname -s`/`uname -m`/docker-latest.tgz
 
 srcrelease: $(SRCRELEASE)
 deps: $(DOCKER_DIR)
@@ -60,6 +61,7 @@ $(SRCRELEASE):
 $(BINRELEASE): $(SRCRELEASE)
 	rm -f $(BINRELEASE)
 	cd $(SRCRELEASE); make; cp -R bin docker-$(RELEASE_VERSION); tar -f ../$(BINRELEASE) -zv -c docker-$(RELEASE_VERSION)
+	cd $(SRCRELEASE); cp -R bin docker-latest; tar -f ../docker-latest.tgz -zv -c docker-latest
 
 clean:
 	@rm -rf $(dir $(DOCKER_BIN))
diff --git a/hack/dockerbuilder/Dockerfile b/hack/dockerbuilder/Dockerfile
index 5b2504d378..50993ed7b5 100644
--- a/hack/dockerbuilder/Dockerfile
+++ b/hack/dockerbuilder/Dockerfile
@@ -27,5 +27,4 @@ run	apt-get install -y -q devscripts
 # Copy dockerbuilder files into the container
 add	.       /src
 run	cp /src/dockerbuilder /usr/local/bin/ && chmod +x /usr/local/bin/dockerbuilder
-run	cp /src/s3cfg /.s3cfg
 cmd	["dockerbuilder"]
diff --git a/hack/dockerbuilder/dockerbuilder b/hack/dockerbuilder/dockerbuilder
index d2e4396550..9fa05ce11e 100644
--- a/hack/dockerbuilder/dockerbuilder
+++ b/hack/dockerbuilder/dockerbuilder
@@ -13,12 +13,10 @@ fi
 
 export REVISION=$1
 
-if [ -z "$AWS_ID" ]; then
-	echo "Warning: environment variable AWS_ID is not set. Won't upload to S3."
-fi
-
-if [ -z "$AWS_KEY" ]; then
-	echo "Warning: environment variable AWS_KEY is not set. Won't upload to S3."
+if [ -z "$AWS_ID" -o -z "$AWS_KEY" ]; then
+	echo "Warning: either AWS_ID or AWS_KEY environment variable not set. Won't upload to S3."
+else
+	/bin/echo -e "[default]\naccess_key = $AWS_ID\nsecret_key = $AWS_KEY\n" > /.s3cfg
 fi
 
 if [ -z "$GPG_KEY" ]; then
@@ -35,6 +33,9 @@ else
 	make release RELEASE_VERSION=$REVISION
 fi
 
+# Remove credentials from container
+rm -f /.s3cfg
+
 if [ -z "$NO_UBUNTU" ]; then
 	export PATH=`echo $PATH | sed 's#/usr/local/go/bin:##g'`
 	(cd packaging/ubuntu && make ubuntu)
diff --git a/hack/dockerbuilder/s3cfg b/hack/dockerbuilder/s3cfg
deleted file mode 100644
index 963af7d365..0000000000
--- a/hack/dockerbuilder/s3cfg
+++ /dev/null
@@ -1,3 +0,0 @@
-[default]
-access_key = $AWS_ID
-secret_key = $AWS_KEY

From 080f35fe65a7bb88ccf2abefa985c7a4ae88a47b Mon Sep 17 00:00:00 2001
From: Solomon Hykes <solomon@dotcloud.com>
Date: Fri, 14 Jun 2013 16:24:22 -0700
Subject: [PATCH 2/3] Fix a bug which caused builds to fail if ADD was the
 first command

---
 buildfile.go | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/buildfile.go b/buildfile.go
index 3c706b04ba..aaa6f6bc7c 100644
--- a/buildfile.go
+++ b/buildfile.go
@@ -178,6 +178,8 @@ func (b *buildFile) CmdAdd(args string) error {
 	cmd := b.config.Cmd
 
 	// Create the container and start it
+	b.config.Cmd = []string{"/bin/sh", "-c", fmt.Sprintf("#(nop) ADD %s in %s", orig, dest)}
+	b.config.Image = b.image
 	container, err := b.builder.Create(b.config)
 	if err != nil {
 		return err

From 6746c385bd7938e1bbcf588a27651de63a2de04a Mon Sep 17 00:00:00 2001
From: Solomon Hykes <solomon@dotcloud.com>
Date: Sat, 15 Jun 2013 12:09:10 -0700
Subject: [PATCH 3/3] FIXMEs

---
 FIXME | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/FIXME b/FIXME
index aaf4c23266..b88757e229 100644
--- a/FIXME
+++ b/FIXME
@@ -16,15 +16,21 @@ to put them - so we put them here :)
 * Unify build commands and regular commands
 * Move source code into src/ subdir for clarity
 * Clean up the Makefile, it's a mess
-- docker buidl: show short IDs
-- docker build: on non-existent local path for ADD, don't show full absolute path on the host
-- mount into /dockerinit rather than /sbin/init
-- docker tag foo REPO:TAG
-- use size header for progress bar in pull
-- Clean up context upload in build!!!
-- Parallel pull
-- Ensure /proc/sys/net/ipv4/ip_forward is 1
-- Force DNS to public!
-- Always generate a resolv.conf per container, to avoid changing resolv.conf under thne container's feet
-- Save metadata with import/export
-- Upgrade dockerd without stopping containers
+* docker buidl: show short IDs
+* docker build: on non-existent local path for ADD, don't show full absolute path on the host
+* mount into /dockerinit rather than /sbin/init
+* docker tag foo REPO:TAG
+* use size header for progress bar in pull
+* Clean up context upload in build!!!
+* Parallel pull
+* Ensure /proc/sys/net/ipv4/ip_forward is 1
+* Force DNS to public!
+* Always generate a resolv.conf per container, to avoid changing resolv.conf under thne container's feet
+* Save metadata with import/export
+* Upgrade dockerd without stopping containers
+* bring back git revision info, looks like it was lost
+* Simple command to remove all untagged images
+* Simple command to clean up containers for disk space
+* Caching after an ADD
+* entry point config
+* bring back git revision info, looks like it was lost