This tutorial demonstrates how to use the scene editor Yohoho Tools to create a dock.
So you start with your island
First, you add a jetty edge. Try to make it line up nicely with the actual coast--some locations line up nicely, some overlap oddly and look...broken.
Next, use the jetty ground tile (in this case, front, because the face of it faces us), and drag it on top of the outermost edge of your island. It will expand out to make the proper edges if you overlap it on top of your existing land. This is probably the toughest part of getting a dock built, because it can easily misbehave on you.
Tidy up the far edge by using Jettyedge Cracks. These form the back edge of a front-facing jetty. Note that you don't need these for back-facing jetties.
Next, grab some town wood planks, and make your actual dock. Do not overlap the Jetty Edge object, or it gets ugly.
Now, to help illustrate the following step, I change the default background tile to interior royal carpet. You'll see why in a moment.
To get the supports for the wood planks, we have to add seawater tiles manually. Note that this is one of the very few times you do this--normally, sea water tiles are NOT added to the edges of the island. Note how that I also add seawater to the corners of the dock.
Finally, switching the default tile back to seawater, you wind up with this.
Tada! You have a dock. Back-facing docks are done pretty much the same way, minus the step of the jettyedge cracks.
This tutorial was adapted from a forum post by Emerson.