Multi-dimensional composite nanocontainers provided an opportunity to prolong the service life of waterborne self-healing coatings through combining intelligent protection with physical barrier. Herein, we constructed a benzotriazole (BTA) corrosion inhibitor loaded nanocontainer with barrier/controlled release/corrosion inhibition properties by assembling graphitic (g)-C3N4 lamella, hollow polyaniline capsule and outer polydopamine wall. Hollow polyaniline and g-C3N4 lamella with adsorption properties provide effective space and sites for loading BTA corrosion inhibitor. Outer polydopamine wall can not only realize the controlled release of corrosion inhibitor, but also ensure the good compatibility between the composite container and the water-based epoxy resin. In addition, polydopamine (PDA) and polyaniline (PANI) as a container frame can also serve as active inhibitors after the release of corrosion inhibitor to enhance the self-healing protection effect of waterborne coatings. In comparative evaluation, the composite coatings containing BTA-loaded nanocontainers (0.5 wt.%) exhibit obviously physical barrier effect after soaking in 3.5 wt.% NaCl solution for 40 days, and maintains good protective performance after immersion for 80 days. Meanwhile, the artificial scratch experiment verified the effective self-repair protection of the composite container to the coating under the condition of damage. To be sure, it will provide an effective improvement idea for the long-term application of waterborne epoxy coating in marine environment.