@Mohamed Ayman @Tej_Singh_Rana @Mumshad Mannambeth,All Need help with when to u . . .

V S Charan kumar Reddy Bakka:
@Mohamed Ayman @Tej_Singh_Rana @Mumshad Mannambeth,All

Need help with when to use ‘args’ and when to use ‘coomand’ in a container spec. OR both are same and we can use any?

V S Charan kumar Reddy Bakka:
i think we can specify args also in ‘command’ itself…please clarify

Tanumoy Ghosh:
Same question - it asks to run the command sleep 3600 in busybox container

kubectl run busybox --image busybox -- /bin/sh -c 'sleep 3600'

This would actually write the sleep 3600 in args instead of command, is that accepted or do we need to modify the args as command in the yaml, please confirm

Mohamed Ayman:
command on file map to the entry point on docker file and args on file map to cmd on docker file.

When you override the default Entrypoint and Cmd, these rules apply:

  • If you do not supply command or args for a Container, the defaults defined in the Docker image are used.

  • If you supply a command but no args for a Container, only the supplied command is used. The default EntryPoint and the default Cmd defined in the Docker image are ignored.

  • If you supply only args for a Container, the default Entrypoint defined in the Docker image is run with the args that you supplied.

  • If you supply a command and args, the default Entrypoint and the default Cmd defined in the Docker image are ignored. Your command is run with your args

please check here for more info https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/|https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/