eth-cscs / sarus

OCI-compatible engine to deploy Linux containers on HPC environments.
https://sarus.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
127 stars 10 forks source link

Issue when just appending flags for image with entrypoint set #12

Closed haampie closed 3 years ago

haampie commented 4 years ago

Currently I cannot do:

$ sarus run gcr.io/kaniko-project/executor --dockerfile something
Invalid image ID ["gcr.io/kaniko-project/executor", "--dockerfile"]
The image ID is expected to be a single token without options
See 'sarus help run'

Whereas docker run gcr.io/kaniko-project/executor --dockerfile /something works.

Note that I cannot just provide the binary like docker run gcr.io/kaniko-project/executor /kaniko/executor --dockerfile /something, because there is no shell or anything (see https://github.com/GoogleContainerTools/kaniko/blob/master/deploy/Dockerfile#L35)

The workaround seems to be adding '' as an initial argument:

$ sarus run gcr.io/kaniko-project/executor '' --dockerfile something

Can this be avoided?

Madeeks commented 4 years ago

Hello @haampie, thanks for the report! Improvements for the CLI are in the works, we'll do our best to have a look into this behavior as well.

Madeeks commented 3 years ago

Hi @haampie, as of release 1.3.0, Sarus correctly processes option arguments entered after the image identifier:

amadonna@localhost:~> sarus run --entrypoint=ls ubuntu -l -a /home
total 0
drwxr-xr-x 2 amadonna amadonna   3 Apr 15  2020 .
drwxr-xr-x 1 amadonna amadonna 140 Oct 23 19:17 ..

Let me know if you still encounter problems with the new version or I can close this issue.