ReproNim / neurodocker

Generate custom Docker and Singularity images, and minimize existing containers
https://www.repronim.org/neurodocker/
Apache License 2.0
326 stars 97 forks source link

modifying value for entry point to allow -arg or --arg #515

Closed djarecka closed 1 year ago

djarecka commented 1 year ago

this PR would allow to have -arg and --arg when using "", e.g. "command -arg"

fixes #507

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02 :tada:

Comparison is base (19b6a94) 88.77% compared to head (85cf1b7) 88.79%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #515 +/- ## ========================================== + Coverage 88.77% 88.79% +0.02% ========================================== Files 11 11 Lines 1033 1035 +2 ========================================== + Hits 917 919 +2 Misses 116 116 ``` | [Impacted Files](https://codecov.io/gh/ReproNim/neurodocker/pull/515?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ReproNim) | Coverage Δ | | |---|---|---| | [neurodocker/cli/generate.py](https://codecov.io/gh/ReproNim/neurodocker/pull/515?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ReproNim#diff-bmV1cm9kb2NrZXIvY2xpL2dlbmVyYXRlLnB5) | `91.73% <100.00%> (+0.07%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ReproNim). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ReproNim)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

kaczmarj commented 1 year ago

let me test this and get back to you. thanks for tackling the issue

kaczmarj commented 1 year ago

thanks dorota, this works for me. i ran the following

neurodocker generate docker --base-image debian --pkg-manager apt --entrypoint "bash -c"

and I got the following Dockerfile:

# Generated by Neurodocker and Reproenv.

FROM debian
ENTRYPOINT ["bash", "-c"]

# Save specification to JSON.
RUN printf '{ \
  "pkg_manager": "apt", \
  "existing_users": [ \
    "root" \
  ], \
  "instructions": [ \
    { \
      "name": "from_", \
      "kwds": { \
        "base_image": "debian" \
      } \
    }, \
    { \
      "name": "entrypoint", \
      "kwds": { \
        "args": [ \
          "bash", \
          "-c" \
        ] \
      } \
    } \
  ] \
}' > /.reproenv.json
# End saving to specification to JSON.
kaczmarj commented 1 year ago

feel free to merge once the tests pass