Finger vein recognition has drawn increasing attention from biometrics community due to its security and convenience. In this paper, a novel discriminative binary codes (DBC) learning method is proposed for finger vein recognition. First of all, subject relation graph is built to capture correlations among subjects. Based on the relation graph, binary templates are transformed to describe vein characteristics of subjects. To ensure that templates are discriminative and representative, graph transform is formulated into an optimization problem, in which the distance between templates from different subjects is maximized and templates provide maximum information about subjects. At last, supervised information for training instances is provided by the obtained binary templates, and SVMs are trained as the code learner for each bit. Compared with existing binary codes for finger vein recognition, DBC are more discriminative and shorter. In addition, they are generated with considering the relationships among subjects which may be useful to improve performance. Experimental results on PolyU database and MLA database demonstrate the effectiveness and efficiency of DBC for finger vein recognition and retrieval.