When the second peer is set up, the correct address of the first peer should be put in the CORE_PEER_DISCOVER_ROOTNODE parameter.
docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:4243 -e CORE_PEER_ID=vp1 -e CORE_PEER_ADDRESSAUTODETECT=true -e CORE_PEER_DISCOVERY_ROOTNODE=172.17.0.2:30303 hyperledger-peer peer peer
If the code is being run in different machines, there lies a possibility that you'll have to forward ports. And if you are running the peer inside Vagrant you'll need to forward Vagrant ports too.