diff --git a/scripts/bootstrap-to-docker.sh b/scripts/bootstrap-to-docker.sh index 11ce0aa..75ee8c5 100755 --- a/scripts/bootstrap-to-docker.sh +++ b/scripts/bootstrap-to-docker.sh @@ -143,13 +143,13 @@ for ((i=0; i<${#distros[@]}; ++i)); do fi echo " ---- mount filesystems in ${tmpdir}/${distro}-${arch}" 1>&2 for x in proc sys dev; do - if mount | grep -q "${tmpdir}/${distro}-${arch}"/$x/; then - umount -flr "${tmpdir}/${distro}-${arch}"/$x/ + if mount | grep -q "${tmpdir}/${distro}-${arch}"/$x; then + sudo umount -flr "${tmpdir}/${distro}-${arch}"/$x fi done - sudo mount -t proc proc "${tmpdir}/${distro}-${arch}"/proc/ - sudo mount -t sysfs sys "${tmpdir}/${distro}-${arch}"/sys/ - sudo mount -o bind /dev "${tmpdir}/${distro}-${arch}"/dev/ + sudo mount -t proc proc "${tmpdir}/${distro}-${arch}"/proc + sudo mount -t sysfs sys "${tmpdir}/${distro}-${arch}"/sys + sudo mount -o bind /dev "${tmpdir}/${distro}-${arch}"/dev echo " ---- preconfigure debian packages in ${tmpdir}/${distro}-${arch}" 1>&2 sudo chroot "${tmpdir}/${distro}-${arch}" debconf-set-selections <&2 for x in proc sys dev; do - if mount | grep -q "${tmpdir}/${distro}-${arch}"/$x/; then - umount -flr "${tmpdir}/${distro}-${arch}"/$x/ + if mount | grep -q "${tmpdir}/${distro}-${arch}"/$x; then + sudo umount -flr "${tmpdir}/${distro}-${arch}"/$x fi done echo " ---- import ${tmpdir}/${distro}-${arch} to ${docker_user}/${type}:${distro}-${arch}" 1>&2