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

Error when loading a docker image #381

Open
emedernach opened this issue Jan 16, 2023 · 5 comments
Open

Error when loading a docker image #381

emedernach opened this issue Jan 16, 2023 · 5 comments

Comments

@emedernach
Copy link

Hello,

We are trying to load a docker image and we obtain this error:

$ udocker --version
version: 1.3.5

$ udocker load -i Simple.tgz Simple
Traceback (most recent call last):
  File ".../udocker", line 64, in <module>
    main()
  File ".../udocker", line 42, in main
    exit_status = UMain(sys.argv).execute()
  File ".../umain.py", line 107, in execute
    exit_status = cmds[command](self.cmdp)  # executes command
  File ".../cli.py", line 308, in do_load
    repos = self.localfileapi.load(imagefile, imagerepo)
  File ".../localfile.py", line 36, in load
    self.localrepo).load(tmp_imagedir, imagerepo)
  File ".../docker.py", line 758, in load
    repositories = self._load_repositories(structure)
  File ".../docker.py", line 741, in _load_repositories
    loaded_repo = self._load_image(structure, imagerepo, tag)
  File ".../commonlocalfile.py", line 67, in _load_image
    return self._load_image_step2(structure, imagerepo, tag)
  File ".../docker.py", line 714, in _load_image_step2
    json_file = structure["repoconfigs"][json_config_file]["json_f"]
KeyError: 'config.json'

Our image is generated with Guix. Here is a minimal image with this error:
Simple.tgz

Best regards,

Medernach Emmanuel

@emedernach
Copy link
Author

Hello,

We managed to solve the problem by modifying the _load_structure method (in docker.py line 631):

            # elif len(fname) >= 69 and fname.endswith(".json"):
            elif fname.endswith(".json"):

Best regards,

Medernach Emmanuel

@emedernach
Copy link
Author

emedernach commented Feb 2, 2023

Hello,

The issue is still there when we use 'import' but it works with 'load', you could test it with this docker image:

Minimal Docker Image with /bin/bash

** With udocker import

# udocker import Bash-02Feb2023.tar.gz Bash-02Feb2023
# udocker create --name=test-02Feb2023 Bash-02Feb2023
# udocker ps
...
4a707804-5305-3fc7-bc82-6f9ced83296d . W ['test-02Feb2023'] Bash-02Feb2023:latest
# udocker run 4a707804-5305-3fc7-bc82-6f9ced83296d /bin/bash
Error: command not found or has no execute bit set:  ['/bin/bash']

** With udocker load

# udocker load -i Bash-02Feb2023.tar.gz Bash-02Feb2023-loaded
# udocker create --name=test-02Feb2023-loaded Bash-02Feb2023-loaded
fa3e6205-3969-3353-94ec-237339b3138b
# udocker run fa3e6205-3969-3353-94ec-237339b3138b /bin/bash
 
 ******************************************************************************
 *                                                                            *
 *               STARTING fa3e6205-3969-3353-94ec-237339b3138b                *
 *                                                                            *
 ******************************************************************************
 executing: bash

Best regards,

Medernach Emmanuel

@jorge-lip
Copy link
Collaborator

If you can please post again the tar files.
Thanks !

@emedernach
Copy link
Author

Hello,

Here is a docker image (Simple.tgz):

https://filesender.renater.fr/?s=download&token=2ce8811a-39ca-4565-858f-b96d84669e87

@jorge-lip
Copy link
Collaborator

This should be fixed, if the problem persists please let us know.

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