tar: Refusing to read archive contents from terminal (missing -f option?)

1,032 views
Skip to first unread message

Jai Dayal

unread,
Dec 21, 2017, 4:42:32 AM12/21/17
to singularity
Hi,

I am trying to create a centos image that's big enough for me to install things into it. Here are the steps I'm doing

$ sudo singularity image.create --size 2048 centos.img

Creating empty 2048MiB image file: centos.img
Formatting image with ext3 file system
Image is done: centos.img

$ sudo singularity image.import centos.img docker://centos:latest

tar: Refusing to read archive contents from terminal (missing -f option?)
tar: Error is not recoverable: exiting now


Any advice on what I need to do? I want this image to be writable so I can have the changes persist. 

Thanks

David Godlove

unread,
Dec 21, 2017, 10:46:10 AM12/21/17
to singu...@lbl.gov
Top of the morning to you Jai!

I think the best thing to do would be something more like this:

$ sudo singularity build --sandbox centos.img docker://centos:latest

Then when you want to tinker with it, use the container like so:

$ sudo singularity shell --writable centos.img

Does that work?

Dave

--
You received this message because you are subscribed to the Google Groups "singularity" group.
To unsubscribe from this group and stop receiving emails from it, send an email to singularity+unsubscribe@lbl.gov.

Jai Dayal

unread,
Dec 21, 2017, 1:04:11 PM12/21/17
to singularity
This works. Thanks.

Also, if I do image.expand on the original non sandbox centos.img, it also throws errors.

Maybe it's not intended to work this way?

Jeff Kriske

unread,
Dec 21, 2017, 2:23:17 PM12/21/17
to singularity
Not anymore with 2.4+.

Jeff Kriske

unread,
Dec 21, 2017, 2:40:36 PM12/21/17
to singularity
I should be more specific, it'll work with the legacy format (ext3) as long as you haven't imported an image. Once you do, it will no longer function like 2.3.x (you can no longer resize it)

You can either use the sandbox as Dave mentioned previously or for the newer image format you can use with sudo singularity build centos.simg docker://centos:latest but this won't be writable. 
I usually experiment in the sandbox and then create a recipe to build a proper immutable image.

-Jeff
Reply all
Reply to author
Forward
0 new messages