pre-commit from templates.

- Use common pre-commit snippet for Docker projects.
- Use GitLab CI template for pre-commit job.