diff --git a/docker/build/precise-common/Dockerfile b/docker/build/precise-common/Dockerfile
index 0fb2cb6..0a4a556 100644
--- a/docker/build/precise-common/Dockerfile
+++ b/docker/build/precise-common/Dockerfile
@@ -14,14 +14,14 @@ RUN useradd docker && echo "docker:docker" | chpasswd
 RUN echo "docker ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
 RUN mkdir -p /home/docker && chown -R docker:docker /home/docker
 RUN apt-get install -y \
-    python2.7 \
-    python2.7-dev \
-    python-pip \
+    git \
+    libmysqlclient-dev \
     python-apt \
-    python-yaml \
     python-jinja2 \
-    git \
-    libmysqlclient-dev
+    python-pip \
+    python-yaml \
+    python2.7 \
+    python2.7-dev
 
 # Temporary hacking related to an SELinux bug.  This issue causes, at least,
 # useradd to fail silently when the -m flag is passed in.  The bug affects
diff --git a/docker/build/trusty-common/Dockerfile b/docker/build/trusty-common/Dockerfile
index 19c937f..84d605f 100644
--- a/docker/build/trusty-common/Dockerfile
+++ b/docker/build/trusty-common/Dockerfile
@@ -14,14 +14,14 @@ RUN useradd docker && echo "docker:docker" | chpasswd
 RUN echo "docker ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
 RUN mkdir -p /home/docker && chown -R docker:docker /home/docker
 RUN apt-get install -y \
-    python2.7 \
-    python2.7-dev \
-    python-pip \
-    python-apt \
-    python-yaml \
-    python-jinja2 \
     git \
     libmysqlclient-dev \
+    python-apt \
+    python-jinja2 \
+    python-pip \
+    python-yaml \
+    python2.7 \
+    python2.7-dev
 
 USER docker