From 8e43db95f2299f9b63ab3d1728e73f2a5f6600b3 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Wed, 23 Oct 2013 14:08:16 -0600 Subject: [PATCH] Update all the mkimage scripts to use --numeric-owner as a tar argument to properly preserve ownership --- contrib/mkimage-arch.sh | 2 +- contrib/mkimage-busybox.sh | 2 +- contrib/mkimage-debootstrap.sh | 4 ++-- contrib/mkimage-unittest.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/mkimage-arch.sh b/contrib/mkimage-arch.sh index 3b86022206..db14e8674e 100755 --- a/contrib/mkimage-arch.sh +++ b/contrib/mkimage-arch.sh @@ -62,6 +62,6 @@ mknod -m 666 ${DEV}/full c 1 7 mknod -m 600 ${DEV}/initctl p mknod -m 666 ${DEV}/ptmx c 5 2 -tar -C $ROOTFS -c . | docker import - archlinux +tar --numeric-owner -C $ROOTFS -c . | docker import - archlinux docker run -i -t archlinux echo Success. rm -rf $ROOTFS diff --git a/contrib/mkimage-busybox.sh b/contrib/mkimage-busybox.sh index 909ad4794a..7eed0c800c 100755 --- a/contrib/mkimage-busybox.sh +++ b/contrib/mkimage-busybox.sh @@ -35,5 +35,5 @@ do cp -a /dev/$X dev done -tar -cf- . | docker import - busybox +tar --numeric-owner -cf- . | docker import - busybox docker run -i -u root busybox /bin/echo Success. diff --git a/contrib/mkimage-debootstrap.sh b/contrib/mkimage-debootstrap.sh index fbddaafe3c..b0a370da7d 100755 --- a/contrib/mkimage-debootstrap.sh +++ b/contrib/mkimage-debootstrap.sh @@ -189,10 +189,10 @@ if [ "$justTar" ]; then touch "$repo" # fill the tarball - sudo tar -caf "$repo" . + sudo tar --numeric-owner -caf "$repo" . else # create the image (and tag $repo:$suite) - sudo tar -c . | $docker import - $repo $suite + sudo tar --numeric-owner -c . | $docker import - $repo $suite # test the image $docker run -i -t $repo:$suite echo success diff --git a/contrib/mkimage-unittest.sh b/contrib/mkimage-unittest.sh index cbfeb4b72f..af6488e9b7 100755 --- a/contrib/mkimage-unittest.sh +++ b/contrib/mkimage-unittest.sh @@ -44,6 +44,6 @@ do done chmod 0755 $ROOTFS # See #486 -tar -cf- . | docker import - docker-ut +tar --numeric-owner -cf- . | docker import - docker-ut docker run -i -u root docker-ut /bin/echo Success. rm -rf $ROOTFS