Her royal cuteness climbed 1600 feet yesterday on a bike ride. I unsnapped her from the leash and off she went, wondering why I was so slow!
There are pretty good products you can buy online to take your dog along on a bike ride. But will they fit your bike? Think of all the variations in bike geometries out there!
But there is a trick: strapping on a small board to a straight section of your rear triangle. Look at the rear triangle of my mountain bike:
Attaching to my bike is not straightforward. The rear axle proper is not available because of the special parts that go along with the Old Man Mountain rear rack.
Notice the weird bend in the chainstay, the tube that connects the rear axle to the crank area ("bottom bracket") of the bike. But it doesn't matter because at least the seatstay is a straight tube. (The seatstay is the tube that slants up from the rear axle towards the seat/saddle.)
With a straight tube you can strap on a straight piece of wood. 
Whatever bracket you use for mounting the standoff needs to be rearward of the rear axle so that your ankle doesn't hit it.
Wood is easy to work with. You could mount a right-angle metal bracket from a hardware store, and attach a stick of wood as the standoff. That is what I did first. But who wants to use tools or a clumsy wingnut to remove the wood, so you can store your bike?
That is why I went to the plumbing department of the hardware store, and mounted a "floor bracket" to the wooden board. Then you screw the 1 foot section of PVC pipe into the floor bracket. 
What if you fall on the right side of the bike or bash this pipe into a boulder? It will snap off. But you want it to. It is inexpensive. Keep a couple backup pieces in stock.
It is critically important to use the right length of bungee cord.  (Black in the photo above.) The dog must not get ahead of your front axle, or every squirrel becomes a disaster!
 You could use metal hose clamps from a hardware store, but I recommend the nylon hose clamps from Topeak, called "Versamount." I prefer to use a hardwood board, rather than soft pine.
 I am using a nominal 3/4" PVC tube, but you might prefer at 1" tube for a bigger dog. Hardware stores sell 1 foot sections, threaded on both ends.
 For my 20 pound poodle mix, a 3/8" bungee cord is strong enough. You might need one of those black rubber tie-down straps for a larger dog.