aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSteven Dake <stdake@cisco.com>2015-02-12 15:49:57 -0700
committerSteven Dake <stdake@cisco.com>2015-02-16 20:24:15 -0700
commit1078eddf1161786e54225fbf3ecfa972b46b0450 (patch)
tree003f5f332a17595b14299ea7b8e740c49183db8e /tools
parentddc12789bc0536a2a5dec419124817de9152d292 (diff)
downloadkolla-1078eddf1161786e54225fbf3ecfa972b46b0450.tar.gz
kolla-1078eddf1161786e54225fbf3ecfa972b46b0450.zip
Allow symlinks in the container build
This patch permits symlinks in the docker build. Normally docker does not permit symlinked files in the build context sent to the docker server. To work around this problem, a secure directory is created in /tmp and the container contents are copied to that directory. Any symlinks are turned into their non-symlinked equivalents. Change-Id: I38cd5aeed4c73b90449354a0979fc6ddf7891ccb Implements-blueprint: linked-build
Diffstat (limited to 'tools')
-rwxr-xr-xtools/build-docker-image6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/build-docker-image b/tools/build-docker-image
index ac1277621..82d210d0c 100755
--- a/tools/build-docker-image
+++ b/tools/build-docker-image
@@ -88,10 +88,14 @@ if [ "$MODE" = "release" ]; then
echo
fi
-if ! docker build ${BUILDFLAGS} -t "$FULLIMAGE" $IMGDIR; then
+TMPDIR=$(mktemp -d /tmp/output.XXXXXXXXXX)
+cp -aL $IMGDIR/* $TMPDIR
+
+if ! docker build ${BUILDFLAGS} -t "$FULLIMAGE" $TMPDIR; then
echo "ERROR: failed to build $FULLIMAGE"
exit 1
fi
+rm -rf $TMPDIR
echo "Built: $FULLIMAGE"