Container-based smart nanocoatings for corrosion protection