Can I grow melons out of a bag of dirt?
Thank you for your question to eXtension.
You can certainly TRY to grow a melon plant out of a bag of potting soil, but I don't think you'll be very successful. Most melon plants need a lot of room for their roots to spread. They also need to good soil drainage (which you'd have) and plenty of water. Any water stress can cause the plant to refuse to bear fruit, or even die all the way.
Most plants that are grown in containers are small (radishes, carrots), or dwarf varieties (bush tomatoes, bush cucumbers, etc.). Purdue's publication on container gardening lists a bunch of plants that should do OK in containers, but melons are not listed: http://www.hort.purdue.edu/ext/HO-200.pdf . If you can't grow them in a container, I doubt you can grow them in a bag.