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

Crash when passing -v to container command #12

Open
akloeker opened this issue Jan 17, 2025 · 0 comments
Open

Crash when passing -v to container command #12

akloeker opened this issue Jan 17, 2025 · 0 comments

Comments

@akloeker
Copy link
Member

Minimal example:

Command:

docker-run ubuntu:22.04 echo -v

Output:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/sysadmin/.local/lib/python3.10/site-packages/docker_run/__main__.py", line 5, in <module>
    generateDockerCommand()
  File "/home/sysadmin/.local/lib/python3.10/site-packages/docker_run/core.py", line 178, in generateDockerCommand
    cmd = buildDockerCommand(vars(args), unknown_args, cmd_args)
  File "/home/sysadmin/.local/lib/python3.10/site-packages/docker_run/core.py", line 151, in buildDockerCommand
    docker_cmd = plugin.modifyFinalCommand(docker_cmd, args, unknown_args)
  File "/home/sysadmin/.local/lib/python3.10/site-packages/docker_run/plugins/core.py", line 63, in modifyFinalCommand
    cmd = cls.resolveRelativeVolumeFlags(cmd)
  File "/home/sysadmin/.local/lib/python3.10/site-packages/docker_run/plugins/core.py", line 142, in resolveRelativeVolumeFlags
    mount_path = cmd[i + 1].split(":")[0]
IndexError: list index out of range

Expected Output:

-v

For comparison, normal docker run works fine.

Command:

docker run ubuntu:22.04 echo -v

Output:

-v
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

1 participant