macOS and docker for mac don't play nicely with mktemp

On macOS mktemp -d drops something in /var/folders, which isn't
shared by default with Docker for Mac. Thus I can't run docker
with that volume mounted to build binaries for test images. So
instead, tell mktemp to use kubernetes/_tmp as its base, which
is what I see some of the hack/verify-* scripts use.
pull/8/head
Aaron Crickenberger 2018-08-07 17:36:33 -07:00
parent 5de3896d0d
commit 2de8daf024
1 changed files with 4 additions and 1 deletions

View File

@ -56,7 +56,10 @@ build() {
# Create a temporary directory for every architecture and copy the image content # Create a temporary directory for every architecture and copy the image content
# and build the image from temporary directory # and build the image from temporary directory
temp_dir=$(mktemp -d) mkdir -p ${KUBE_ROOT}/_tmp
temp_dir=$(mktemp -d ${KUBE_ROOT}/_tmp/test-images-build.XXXXXX)
kube::util::trap_add "rm -rf ${temp_dir}" EXIT
cp -r ${IMAGE}/* ${temp_dir} cp -r ${IMAGE}/* ${temp_dir}
if [[ -f ${IMAGE}/Makefile ]]; then if [[ -f ${IMAGE}/Makefile ]]; then
# make bin will take care of all the prerequisites needed # make bin will take care of all the prerequisites needed