Draw GL to Texture2D?

How do I draw the GL commands to a texture instead of the screen?