title: Git Pre-commit hooks
body: <p>I need to set up a series of Gitlab hooks within a Docker image that will be triggered on pre-commit. I have a Docker file and a pre-commit-config.yaml which builds successfully with the exception of one hook which I cannot seem to get working. </p>
  
  <p>.pre-commit-config.yaml</p>
  
  <pre><code>---
  repos:
    - repo: local
      hooks:
        - id: check-merge-conflict
          name: Check for merge conflicts
          description: Check for files that contain merge conflict strings.
          entry: check-merge-conflict
          language: python
          types: [text]
  
        - id: epp-validate
          additional_dependencies: ['puppet']
          description: Validate syntax of Puppet EPP templates
          entry: /puppet-pre-commit-hooks/epp-validate
          files: \.epp$
          language: ruby
          name: Validate EPP templates
  
        - id: erb-validate
          description: Validate syntax of Ruby ERB templates
          entry: /puppet-pre-commit-hooks/erb-validate
          files: \.erb$
          language: ruby
          name: Validate ERB templates
  
        - id: puppet-lint
          additional_dependencies: ['puppet-lint']
          description: Check Puppet manifests for stylistic problems
          entry: /puppet-pre-commit-hooks/puppet-lint
          files: \.pp$
          language: ruby
          name: puppet-lint
          args:
            - --fail-on-warnings
  
        - id: puppet-validate
          additional_dependencies: ['puppet']
          description: Validate syntax of Puppet manifests
          entry: /puppet-pre-commit-hooks/puppet-validate
          files: \.pp$
          language: ruby
          name: Validate Puppet manifests
  
        - id: r10k-validate
          additional_dependencies: ['r10k']
          description: Validate syntax of Puppetfile using r10k
          entry: /puppet-pre-commit-hooks/r10k-validate
          files: ^Puppetfile$
          language: ruby
          name: Validate r10k Puppetfile
  
        - id: ruby-validate
          additional_dependencies: ['ruby']
          description: Validate syntax of ruby code
          entry: /puppet-pre-commit-hooks/ruby-validate
          files: \.rb$
          language: ruby
          name: Validate ruby syntax
  </code></pre>
  
  <p>I have had to set up the hooks as local hooks because the environment that this is being used on has an airgap which prevents access to the internet. To overcome this I have cloned some repos which have the appropriate hooks.</p>
  
  <p>This builds successfully with the exception of the check-merge-conflict hook which it fails to find. In the docker container, the python code for this hook is located in /pre-commit-hooks/pre_commit_hooks/check_merge_commit.py.</p>
  
  <p>I have tried amending the entry: value to 
  '''/pre-commit-hooks/pre_commit_hooks/check_merge_commit
  pre_commit_hooks/check-merge-commit
  check_merge_commit'''</p>
  
  <p>...but none of these worked.</p>
  
  <p>Docker file</p>
  
  <pre><code>FROM ruby:2.5.0
  
  SHELL ["/bin/bash", "-o", "pipefail", "-c"]
  RUN source ~/.profile
  RUN curl https://pre-commit.com/install-local.py | python -
  COPY pre-commit/.pre-commit-config.yaml .
  RUN git clone https://github.com/pre-commit/pre-commit-hooks.git
  RUN git clone https://github.com/chriskuehl/puppet-pre-commit-hooks.git
  RUN git clone https://github.com/adrienverge/yamllint.git
  WORKDIR /jumanjihouse
  RUN git clone https://github.com/jumanjihouse/pre-commit-hooks.git
  RUN rm -rf /jumanjihouse/pre-commit-hooks/.git* /yamllint/.git* /puppet-pre-commit-hooks/.git* /pre-commit-hooks/.git* /usr/local/lib/ruby/gems/2.5.0/gems/*/.git*
  WORKDIR /
  RUN git init
  RUN /root/bin/pre-commit run -a
  </code></pre>
  
  <p>Does anyone know what I am missing/doing wrong? </p>
  
  <p>The hook is from <a href="https://github.com/pre-commit/pre-commit-hooks" rel="nofollow noreferrer">Github</a></p>