also doggie, "a little dog, a pet word for a dog," 1825, from dog (n.) + -y (3). Doggy-bag "bag provided by restaurants for customers to take home leftovers" (presumably to feed to the dog) is attested by 1962.
LIVING IT UP. Marveling at size of sirloin steaks, Dave and Betty celebrate $4-a-week raise at a restaurant dinner. They paid $3.50 each, left with enough uneaten steak in a "doggie bag" to feed themselves, not the dog, all next day. [Life magazine, photo caption from article on living economically, April 6, 1962]
As an adj. doggy is attested from late 14c., from -y (2). The word has been used in various formations at least since late 19c. to describe the rear-entry variant of the human sex act when one partner is on all fours.