From 24a3c28c1deae6fdf1f07efb3c1a54e6acbee847 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 15 Oct 2020 13:26:38 +0200 Subject: [PATCH] Copy output with docker cp (#82) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Copy output with docker cp * Update Makefile Co-authored-by: Sébastien HOUZÉ Co-authored-by: Sébastien HOUZÉ --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 99e51e5e..e5582bc4 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ docker-images: layers: docker-images PWD=pwd rm -rf export/layer-${layer}.zip || true - mkdir export/tmp + mkdir -p export/tmp set -e; \ for dir in layers/${layer}; do \ for php_version in $(php_versions); do \ @@ -45,8 +45,11 @@ layers: docker-images echo "### Exporting $${dir} PHP$${php_version}"; \ echo "###"; \ cd ${PWD} ; rm -rf export/tmp/${layer} || true ; cd export/tmp ; \ - docker run --entrypoint "tar" bref/$${dir}-php-$${php_version} -ch -C /opt . | tar -x ; \ - zip --quiet -X --recurse-paths ../`echo "$${dir}-php-$${php_version}" | sed -e "s/layers\//layer-/g"`.zip . ; \ + CID=$$(docker create --entrypoint=scratch bref/$${dir}-php-$${php_version}) ; \ + docker cp $${CID}:/opt . ; \ + docker rm $${CID} ; \ + cd ./opt ; \ + zip --quiet -X --recurse-paths ../../`echo "$${dir}-php-$${php_version}" | sed -e "s/layers\//layer-/g"`.zip . ; \ echo ""; \ done \ done @@ -81,4 +84,3 @@ publish-docker-images: docker-images done \ done -