Skip to content

Commit

Permalink
Copy output with docker cp (#82)
Browse files Browse the repository at this point in the history
* Copy output with docker cp

* Update Makefile

Co-authored-by: Sébastien HOUZÉ <[email protected]>

Co-authored-by: Sébastien HOUZÉ <[email protected]>
  • Loading branch information
Nyholm and Sébastien HOUZÉ authored Oct 15, 2020
1 parent e96077d commit 24a3c28
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand Down Expand Up @@ -81,4 +84,3 @@ publish-docker-images: docker-images
done \
done


0 comments on commit 24a3c28

Please sign in to comment.