add rule for making the containers from templates

close #685