Answer: You can grow many types of vegetables in containers, yes. A five gallon bucket or half barrel planter would hold a tomato, cucumber or small melon on a trellis; and a cherry tomato will grow in a hanging basket for example. Most gardeners use a soilless mix and some will add a water holding polymer to help with keeping the soil evenly moist (but not soggy). Container veggies need frequent watering to keep the soil moist (especially in the heat of summer) and also need a regular fertilization program. You might wish to look at a book or two about container gardening to help you get started. One I like is "Container Gardening for Dummies" by Bill Marken, ISBN 0-7645-5057-8. In it you will find lots of practical advise.
Q&A Library Searching Tips