YARN-2301. Improved yarn container command. Contributed by Naganarasimha G R
(cherry picked from commit 258623ff8bb1a1057ae3501d4f20982d5a59ea34)