Double layer from least action principle