Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tar: invalid tar magic #120

Closed
seunggookim opened this issue Jun 8, 2022 · 3 comments
Closed

tar: invalid tar magic #120

seunggookim opened this issue Jun 8, 2022 · 3 comments

Comments

@seunggookim
Copy link

seunggookim commented Jun 8, 2022

Hi, I'm trying to create a Singularity image from a Docker image, which was successfully pulled and runs fine. But I get an invalid tar magic error when running:

$ sudo docker run -v /var/run/docker.sock:/var/run/docker.sock -v ~/Downloads:/output --privileged -t --rm quay.io/singularity/docker2singularity --name jukemir jukemir/representations_jukebox

Image Format: squashfs
Docker Image: jukemir/representations_jukebox
Container Name: jukemir

Inspected Size: 15941 MB

(1/10) Creating a build sandbox...
(2/10) Exporting filesystem...
tar: invalid tar magic

So, I opened an interactive shell (-it --entrypoint /bin/bash), installed BSDtar (apk add libarchive-tools), created a symbolic link to /usr/bin/bsdtar from /bin/tar, then it works now:

bash-5.0# ./docker2singularity.sh jukemir/representations_jukebox

Image Format: squashfs
Docker Image: jukemir/representations_jukebox

Inspected Size: 15941 MB

(1/10) Creating a build sandbox...
(2/10) Exporting filesystem...
(3/10) Creating labels...
(4/10) Adding run script...
(5/10) Setting ENV variables...
(6/10) Adding mount points...
(7/10) Fixing permissions...
(8/10) Stopping and removing the container...
(9/10) Building squashfs container...
INFO:    Starting build...

But could there be a workaround still using the BusyBox tar? Thanks!

@vsoch
Copy link
Member

vsoch commented Jun 8, 2022

Oh that's strange! It sounds like the fix you have in mind would work for the base image - would you care to PR to add it?

Also, this tool is a bit old (created before Singularity could pull from docker) in case it's easier you can just do:

$ singularity pull docker://<container>

@seunggookim
Copy link
Author

seunggookim commented Jun 8, 2022 via email

@seunggookim
Copy link
Author

I've installed the prebuilt Singularity (3.10.0) on my local Linux and pull the Docker image with sudo, and the SIF file was successfully created. So, this works well for me! I'm closing the issue. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants