Why would a C-17 Globemaster be painted in Qatar Airways livery?
It is a military C-17 of the Qatar Air Force, one of the four in operation.

It is in this livery as it is being operated by the Qatar Amiri Flight, a VIP airline owned and operated by the government of Qatar. The vast majority of the Qatar Amiri Flight fleet is painted in the standard livery of Qatar Airways, like this A340 below.



The aircraft is only operated by the Qatar Amiri Flight, not owned by it. The picture below shows the Qatar Air Force roundel on the underside of the wing.



Source: www.youtube.com