title: How to build archlinux pkgbuild inside docker with gitlab-ci
body: <p>I need to use gitlab-ci with docker in order to automatically build and test archlinux packages on every commit.</p>
  
  <p>My <code>.gitlab-ci.yml</code>:</p>
  
  <pre><code>image: pritunl/archlinux
  
  before_script:
    - pacman -Su pkgbuild-introspection --noconfirm
  
  stages:
    - build
  
  makepkg:
    script:
      - makepkg --clean --rmdeps --syncdeps --noarchive --noconfirm --noprogressbar --asdeps
    stage: build
  </code></pre>
  
  <p>All is well, but when CI call makepkg command I get this error:</p>
  
  <pre><code>==&gt; ERROR: Running makepkg as root is not allowed as it can cause permanent, catastrophic damage to your system.
  
  ==&gt; ERROR: An unknown error has occurred. Exiting...
  </code></pre>
  
  <p>How can I solve it?</p>