I approach docks in 3 different ways: corners, perimeter, and underneath.
You'll be able to catch fish on one of those approaches throughout the year. Where to throw all depends on the time of year.
Corners: in the Summer and Winter, bass like to put they're backs up against the corners along the dock so they can ambush baitfish or bluegill that swim by. I usually look for deeper dock with corners during the Summer and Winter. They don't want to move much, so make accurate casts!
Perimeter: in the Spring, Summer and Fall, I'll throw along the perimeters of the dock, hitting each side. Bass are active these times of year and they'll chase your bait along the perimeter of the dock. Be sure to get your bait as close to the dock as possible. The deeper the dock, the further back I cast; if the dock is shallow I'll only pitch or cast to the first few posts or edges. Sometimes the bass are on the outside posts, sometimes they're in the middle, sometimes they have their back up against the bank
Underneath docks: I pitch underneath docks during the Summer because it's shaded and cooler under there. I also pitch under docks during the Winter because bass typically like a lot of cover that time of year.
As far as baits go I use 5 different baits: Yamamoto Senko 6"
1. During the Spring, I love to throw a senko around docks. It's just a great bait to throw that time of year and I've caught some hawgs on it. Everyone knows that the Yamamoto senko has the best action. Pay the extra and get a few packs, you'll end up catching more fish! Revenge Swim Jig
2. My favorite bait to throw in April and May is a bluegill colored swim jig. Bluegill love to spawn around dock pilings, so it only makes sense to throw a bluegill swim jig around docks. In the Fall, I throw a shad colored swim jig. This is the best swim jig on the market if you ask me, and it's made in the USA! 6th Sense Crush 50X
3. Another great bait during the Spring and Fall around docks is a squarebill. I tune a Crush 50X to the right or left and bang it off docks, creating a reaction bite. These squarebills are super easy to tune and have a cool custom paint job. Missile Baits Warlock Head
4. During the Spring, bass will spawn around docks. One of the most effective techniques to catch those fish is a shakey head. I thread a trickworm or a baby brush hog on there and get to work. When you thread a craw or creature bait on the back of this shakey head, it presents a defensive crawfish position because this shakey head stands up so well. Roboworm Alive Shad
5. During the Summer and Fall, baitfish will congregate around docks and bass will suspend. Probably the most effective technique for this situation is a drop shot. You won't believe how effective this technique is around docks! I use the Roboworm Alive Shad becuase it mimics a little shad really well and they have a good action.
These are the techniques that I use around docks. I hope this helps you out!