title: Git submodule inside Docker
body: <p>My app have structure like this:</p>
  
  <pre><code>/app
    /web
      /submodule
      package.json
      yarn.lock
      Dockerfile
  .gitsubmodule
  docker-compose.yml
  </code></pre>
  
  <p>Dockerfile in /app/web:</p>
  
  <pre><code># build
  FROM node:10 AS build-env
  WORKDIR /usr/src/app
  
  COPY package.json /usr/src/app/
  COPY yarn.lock /usr/src/app/
  RUN yarn install
  
  COPY . /usr/src/app/
  RUN yarn build
  
  # run
  FROM nginx
  
  COPY --from=build-env /usr/src/app/storybook-static /usr/share/nginx/html
  </code></pre>
  
  <p>In package.json <code>submodule</code> include as dependency:</p>
  
  <pre><code>  "dependencies": {
      "submodule": "file:./submodule",
  </code></pre>
  
  <p>When docker build running <code>yarn install</code> command, an error is thrown:</p>
  
  <pre><code>Building web
  Step 1/9 : FROM node:10 AS build-env
   ---&gt; c0cfd9444538
  Step 2/9 : WORKDIR /usr/src/app
   ---&gt; Using cache
   ---&gt; 31d2e6122773
  Step 3/9 : COPY package.json /usr/src/app/
   ---&gt; Using cache
   ---&gt; 385af24cf951
  Step 4/9 : COPY yarn.lock /usr/src/app/
   ---&gt; Using cache
   ---&gt; 861576eec879
  Step 5/9 : RUN yarn install
   ---&gt; Running in edde173d5035
  yarn install v1.9.2
  [1/4] Resolving packages...
  error Package "submodule" refers to a non-existing file '"/usr/src/app/submodule"'.
  info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
  ERROR: Service 'web' failed to build: The command '/bin/sh -c yarn install' returned a non-zero code: 1
  </code></pre>
  
  <p>If running <code>yarn install</code> without docker everything is fine. How to solve this problem?</p>