There are vending machines for detergent and fabric softener. I think they take quarters and are $1 to $1.50 per one load sized boxes.
I usually just go to the Dollar Tree and buy a $1 box. It fits fine in the luggage and will do several loads. I've also used a plastic jar from some Dole fruit I purchased, and sometimes I also fill that with powder and take it. I am allergic to fabric softeners, so I don't pack any of that.