A molecularly imprinted electrochemiluminescent sensor is developed for the sensitive detection of tetracycline in environmental and food samples. The sensor uses an ionic liquid (i.e. [APMIM]Br) modified graphene-carbon nanotube composite (GMI) material as substrate, a double-layered core-shell metal-organic framework NH2-UiO-66@ZIF-8 (NUZ) loaded bipyridyl ruthenium (NUZ@Ru) as luminescent material, and a molecularly imprinted copolymer of o-phenylenediamine and hydroquinone as recognition element. The ionic liquid-modified graphene-carbon nanotube composite has a favorable three-dimensional structure, high specific surface area, and good hydrophilicity; the core-shell structured metal-organic framework has high stability and plentiful reaction sites for loading; the molecularly imprinted copolymer film has enhanced stability and recognition effect. Hence, the resulting sensor combines the merits of several materials and presents improved performance. Under the optimum detection conditions, it shows a wide linear range of 0.05 µM - 1 mM, a low detection limit of 20 nM, high selectivity, and excellent stability. It has been successfully applied to the detection of tetracycline in different samples.