4

What is the purpose of args if one could specify all arguments using command in kubernetes manifest file? for example i can use below syntax which totally negates the usage of the args.

command: [ "bin/bash", "-c", "mycommand" ]

or also

command:
  - "bin/bash"
  - "-c"
  - "mycommand"
coderanger
  • 52,400
  • 4
  • 52
  • 75
quicksilver
  • 289
  • 5
  • 11

1 Answers1

6

The main reason to use args: instead of command: is if the container has a specific entrypoint directive that you don't want to change. For example if the Dockerfile has ENTRYPOINT ["/myapp"] you might put args: [--log-level=debug] to add that one argument without changing the path to the binary. In many cases it isn't relevant though and you just use command: to do it all at once.

coderanger
  • 52,400
  • 4
  • 52
  • 75