title: Docker build working in my machine but not in Gitlab CI
body: <p>I have a Dockerized Typescript NodeJS aplication and I want to build Docker image from Gitlab CI.</p>
  
  <p><strong>Dockerfile</strong></p>
  
  <pre><code>FROM node:11.13.0-alpine
  
  WORKDIR /usr/src/app/
  
  COPY . .
  RUN npm install
  RUN npm run build
  
  CMD ["node", "dist/main.js"]
  </code></pre>
  
  <p><strong>.gitlab-ci.yml</strong></p>
  
  <pre class="lang-yaml prettyprint-override"><code>image: ubuntu:bionic
  
  stages:
    - deploy
  
  before_script:
    # OS dependencies
    - apt-get update
    - apt-get install -y gnupg2
    - apt-get install -y software-properties-common
  
    # Install docker
    - apt install -y docker.io
    - service docker start
  
    # Install cURL
    - apt-get install -y curl
  
  deploy:
    stage: deploy
    script:
      - docker build -t my_app .
      # more stuff
  </code></pre>
  
  <p>If I run <code>docker build -t my_app .</code> in my local <strong>Mac OS</strong>, everything works fine. But in Gitlab CI (<strong>Ubuntu</strong>), it throws these errors in step <code>RUN npm run build</code>:</p>
  
  <pre><code>src/contact/contact.mapper.ts(1,25): error TS2307: Cannot find module './contact'.
  src/contact/contact.repository.ts(2,25): error TS2307: Cannot find module './contact'.
  src/contact/contact.resolver.ts(3,25): error TS2307: Cannot find module './contact'.
  ...
  </code></pre>
  
  <p>Docker versions are the same in Gitlab CI and my local. Do I need something else to make it work in Ubuntu (Gitlab CI runner image)?</p>
  
  <p>NOTE: I know Docker in Docker can be used in Gitlab CI, but for some reasons I need to install Docker manually.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Also, if I run <code>npm run build</code> in my local (using Node v11.13.0, same version as Dockerfile), it works, too.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I have just run <code>docker built -t my_app .</code> in an Ubuntu machine (using a Vagrant virtual machine) and it doesn't work. So, definitely this errors is about operating system. It works in Mac OS but not in Ubuntu.</p>