144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
-
+
|
…but that will earn you error message from `/bin/ls` complaining that there is no option “`-lR /etc`”!
If you try to “cuddle” the options with the arguments as…
/container/add … entrypoint="ls" cmd="-lR/etc"
…the `/bin/ls` implementation will certainly attempt to treat `/` as an option and die with an error message.(^And it isn't just one implementation's weakness. This happens with the GNU, BSD, _and_ BusyBox implementations of `ls`.)
…the `/bin/ls` implementation will certainly attempt to treat `/` as an option and die with an error message.(^Yes, for certain. I tested the GNU, BSD, _and_ BusyBox implementations of `ls`, and they all do this.)
Things aren’t always this grim. For instance, you can run [my `iperf3` container](/dir/iperf3) as a client instead of its default server mode by saying something like:
/container/add … cmd="-c192.168.88.99"
This relies on the fact that the `iperf3` command parser knows how to break the host name part out from the `-c` option itself, something not all command parsers are smart enough to do. There’s 50 years of Unix and Linux history encouraging programs to rely on the shell to do a lot of work before the program’s `main()` function is even called. The command line processing that `container.npk` applies to its `cmd` argument lacks all that power. If you want Bourne shell parsing of your command line, you have to set it via `ENTRYPOINT` or `CMD` in the `Dockerfile`, then rebuild the image.
|