Skip to content

🐛 -o / --container_option does not work as expected #18

@shnizzedy

Description

@shnizzedy

Describe the bug

The option is listed in the README as

  -o [OPT [OPT ...]], --container_option [OPT [OPT ...]]
                        parameters and flags to pass through to Docker or Singularity

                        This flag can take multiple arguments so cannot be
                        the final argument before the command argument (i.e.,
                        run or any other command that does not start with - or --)

defined here

parser.add_argument(
'-o', '--container_option',
dest='container_option',
action='append',
help='parameters and flags to pass through to Docker or Singularity\n'
'\nThis flag can take multiple arguments so cannot '
'be\nthe final argument before the command argument (i.e.,\nrun '
'or any other command that does not start with - or --)\n',
metavar='OPT'
)

but I don't see that parameter handled anywhere
screenshot of GitHub search for "container_option"

Passing options through don't seem to work with any syntax I've attempted (see "To reproduce" below).

To reproduce

cpac -o --entrypoint=/bin/bash --platform docker run

cpac: error: argument -o/--container_option: expected one argument

cpac -o "--entrypoint=/bin/bash" --platform docker run

cpac: error: argument -o/--container_option: expected one argument

cpac -o="--entrypoint=/bin/bash" --platform docker run

cpac run: error: the following arguments are required: bids_dir, output_dir, level_of_analysis, extra_args

cpac -o="--entrypoint=/bin/bash" --platform docker run bids_dir outputs_dir participant

run.py: error: unrecognized arguments: -o=--entrypoint=/bin/bash

Expected behavior

Any options passed to -o or --container_option are passed through to Docker or Singularity.

Acceptance criteria

  • cpac -o="--entrypoint=/bin/bash" --platform docker run opens a BASH prompt in a C-PAC Docker container

cpac version

0.3.2.post1

C-PAC version

v1.8.1, v1.8.1-dev

Container platform

Docker, Singularity

Metadata

Metadata

Assignees

No one assigned

    Labels

    Hacktoberfesthttps://hacktoberfest.digitalocean.com/bugSomething isn't working

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions