From 6b159e78f52d0b5c9663c91f6f0a71caddeb1fd9 Mon Sep 17 00:00:00 2001
From: Qiu Yu <qiuyu@ebaysf.com>
Date: Tue, 28 Apr 2015 12:33:10 +0800
Subject: [PATCH] Preserve file attributes when copying image dirs for build

Add "-a" to preserve file attributes so that unnecessary Docker image
build can be avoided. Otherwise, build-all-docker-images will generate
additional image layer due to timestamp change.

Change-Id: I893fa0637937c521198f50b1bba203a27c9f00a3
Closes-Bug: 1449287
---
 tools/build-all-docker-images | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/build-all-docker-images b/tools/build-all-docker-images
index 5a10fb90bc..74aa80fb8a 100755
--- a/tools/build-all-docker-images
+++ b/tools/build-all-docker-images
@@ -7,7 +7,7 @@ TOPDIR=$(git rev-parse --show-toplevel)
 WORKDIR=$(mktemp -d /tmp/kolla-workdir.XXXXXXXXXX)
 # Remove $WORKDIR otherwise $TOPDIR is copied *inside* of it
 rm -rf $WORKDIR
-cp -r "$TOPDIR" $WORKDIR
+cp -aL "$TOPDIR" $WORKDIR
 DOCKERDIR="$WORKDIR/docker"
 
 declare -A dependency