Update container name validation

Add `.` to container name pattern, refactor, add test.

As discussed with @crosbymichael and @vieux.

References #3197.