Two-dimensional (2D) nanocontainers provide exciting opportunities in anticorrosion application through a skillful combination of delivery functionality for corrosion inhibitors and barrier property of lamellar materials. Herein, we used a versatile emulsion-induced approach to synthesis sandwich-like 2D nanocontainers based on mesoporous polydopamine (PDA) heterostructures on ultrathin bio-ceramic hydroxyapatite (HA) nanosheets. Triblock copolymer and 1,3,5-trimethyl benzene (TMB) synergistically promote the formation of well-defined mesoporous structure. The porous PDA not only provides large amount of contact interface for embedding benzotriazole (BTA), but also serves as another important corrosion inhibitor to achieve active protection effect. In addition, rich functional groups in PDA structure ensure the fine interface compatibility between lamellar HA and waterborne resin, leading to the improvement in terms of coating barrier performance. In comparative evaluation, the composite coatings containing BTA-loaded nanocontainers (1 wt%) exhibit high impedance value (Zf=0.01 Hz) in 3.5 wt% NaCl solutions for 60 days, indicating the long-term anticorrosion properties. Meanwhile, local electrochemical impedance technology proves nanocontainers with BTA loaded obviously inhibited the corrosion reactivity in corrosive microregions. This work puts new insights into designing functional anticorrosion coatings based on the surface construction on 2D materials, which has potential application for improving coating service life in marine environment.