DO NOT connect the ground wire to the grounded (neutral) conductor, as this could lead to current flowing through the body of the dryer (and potentially through you).
The installation guide for the dryer will have wiring instructions for both 3, and 4 wire configurations. Check the manufacturers documentation for proper wiring, but I would say the first image is likely correct.
Instructions from random Maytag Installation Instructions (PDF)
3 Wire Cord
4 Wire Cord
Update:
After doing some research, and looking at dryer wiring diagrams. It turns out that the green/yellow wire is not a ground wire, it is a neutral to case bonding wire. When this wire is not in use (in a 4-wire installation for example), it is simply connected to the neutral terminal and is unused.
You're asking how to ground it properly.
The instructions are telling you to do something which is not proper. NEMA 10 receptacles don't have ground. So they are telling you to misuse the neutral wire as ground.
In any other application, this would be called "bootlegging ground" and you'd fail a home inspection for it. However, appliance manufacturers have lobbied the NFPA to allow this for dryers and ranges so they don't lose appliance sales. The rationalization - which doesn't make much sense to me - is that dryer receptacles are rarely unplugged, so they're not likely to have a failure.
The failure mode is that if there's any problem with your neutral wire anywhere in your house wiring or dryer cord, the 120V loads will stop working, and the current path through them will connect neutral - and thus the dryer chassis - to 120V. You're dead if you touch the dryer chassis and any other ground. Such as the washing machine right next to it.
Option 1: Ground it, properly.
Don't mess with that heavy 10/2 cable; retrofit a ground wire. This is legal and encouraged. The builder supply sells #8 ground wire by the foot, and it's no bigger than telephone wire. #10 would suffice if you can get that cheap.
Use any feasible route to get back to the service panel that powers the dryer circuit. You do not need to run the ground wire with the conductors, because the ground wire does not carry current except during a fault condition. You don't even need to go back to the panel if you can reach something else that has a #10 ground path back to the panel (water heater, A/C, range). Circuits can share ground as long as they come from the same panel.
Then, install a NEMA 14-30 receptacle. If the neutral is bare, that's allowed because the cable is grandfathered, but wrap it (and the ground, if necessary) with tape so they don't short out. Neutral is not ground, and will be a fraction of a volt higher than ground when the machine is at full load, and you don't want it taking ground as an alternate path.
Option 2. Don't ground it; properly.
Here you leave the wiring, but render it safe. You change the 2-pole breaker in the service panel to GFCI. When the person starts to be shocked, the GFCI trips and saves them.
You must then change the receptacle to NEMA 14, connect nothing to the ground pin, and add a label "GFCI protected / No Equipment Ground". Then you need to change the dryer cord to NEMA 14, following all dryer instructions on how to remove the bootleg neutral-ground bonding on the dryer.
At this point the dryer chassis will "float". A neutral failure will not energize the dryer. A ground fault inside the dryer will electrify its chassis, however that should trip the GFCI before harming a human.
This method only works as a retrofit. It can't be used on new installations; those must be grounded NEMA 14 from the outset.
Best Answer
Getting power to the machine is the easy part. The neutral goes to the silver screw in the center, and the two hots go to the brass screws on either side. Now the machine is powered.
Safety ground is the hard part. You really want that.
If you have a 4-wire cable with NEMA 14-30, you're all set.
If you have a 3-wire cable with NEMA 10-30, you have several options, and the rest of this post is about that.
For dryers and stoves specifically, Code allows you to "cheat": bond ground to the neutral wire. The rationale is there are a lot of old NEMA 10-30's out there, and trouble is unlikely since dryers and stoves are rarely moved and plugs are rarely unplugged. The hazard is, if the neutral fails, it will energize the chassis of the dryer at 120V and will electrocute users, and has. Sometimes fatally.
Install a 4-wire cable to a 14-30. For a dryer circuit, Romex 10/3 is the right stuff, it sells for less than $1/foot. Follow the old wire and replace if feasible. If you're not comfortable going inside the service panel, leave about 4 feet of excess length and call an electrician to make the connections. If you prefer, you could run metallic or non-metallic conduit and use single-wire THWN wire (preferably stranded for easy pulling). Ground is optional in metallic conduit, the conduit is a legit ground path.
Replace the NEMA 10-30 outlet with a 14-30 by running a separate ground wire. It must be at least 10 AWG - single wire will do, but the wire must be bare, green or greeen/yellow, and re-marking another color is not allowed. Route however you can, to either the service panel inside on a ground lug, or to a ground screw inside a box in all-metal conduit that is continuous back to the service panel. This is covered under NEC 250.130(c). Don't connect anywhere else, e.g. not to 120V outlets, those have 12 or 14 gauge ground wires - too thin. You might be able to bond to a water heater's ground, but ask a code expert before you do that.
You cannot buy or hack a 240V-only dryer (which takes NEMA 6-30) and replace your plug and re-designate the white wire to be ground instead. Electrical code does not allow that. You can remove the insulation, but you must remove all of it - hard to do in jacketed Romex.
If you install any wire or grounds, get a book on wiring installation and learn how to do it properly and legally, so the wire is not damaged and any electrician who touches it won't want to tear it out and redo.