Hi Tru,
After careful investigation I concluded that this problem existed only in ver. 2.2. With ver. 2.2.1 everything went smoothly!
But, now I got another problem: The host crashed and rebooted after completing bootstraping. This situation has been reproduced twice on two different hosts (both run RHEL6.7). The image file that was bootstraped was then still perfectly usable after reboot.
##As unprivileged user
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.7 (Santiago)
$ cd /home/chih/src
$ wget
https://github.com/singularityware/singularity/releases/download/2.2.1/singularity-2.2.1.tar.gz$ tar xfz singularity-2.2.1.tar.gz
$ cd singularity-2.2.1
$ ./configure --prefix=/usr/local --sysconfdir=/etc
$ make
$ su
##As privileged user
# make install
# grep secure_path /etc/sudoers
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
# grep chih /etc/sudoers
chih ALL=NOPASSWD:/usr/local/bin/singularity
exit
$ cd ~/containers
$ cp /home/chih/src/singularity-2.2.1/examples/centos.def ./
$ cat centos.def
# Copyright (c) 2015-2016, Gregory M. Kurtzer. All rights reserved.
#
# "Singularity" Copyright (c) 2016, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of any
# required approvals from the U.S. Dept. of Energy). All rights reserved.
BootStrap: yum
OSVersion: 7
MirrorURL:
http://mirror.centos.org/centos-%{OSVERSION}/%{OSVERSION}/os/$basearch/Include: yum
# If you want the updates (available at the bootstrap date) to be installed
# inside the container during the bootstrap instead of the General Availability
# point release (7.x) then uncomment the following line
#UpdateURL:
http://mirror.centos.org/centos-%{OSVERSION}/%{OSVERSION}/updates/$basearch/%runscript
echo "This is what happens when you run the container..."
%post
echo "Hello from inside the container"
yum -y install vim-minimal
$ sudo singularity create container-centos7-test.img
Creating a new image with a maximum size of 768MiB...
Executing image create helper
Formatting image with ext3 file system
Done.
$ sudo singularity bootstrap container-centos7-test.img centos.def
$ singularity shell /home/chih/containers/container-centos6-demo.img
....
Installed:
vim-minimal.x86_64 2:7.4.160-1.el7_3.1
Complete!
Done.
## SSH session to the host froze and then the host was rebooted. I was not able to see what went wrong on the host.