<h1 dir="auto">Bug report</h1>
<p dir="auto">This is my code. It's a hello world app with Next 9.0.1</p>
<p dir="auto">Does not work in docker.</p>
<p dir="auto"><code class="notranslate">docker build -t cgcweb .</code></p>
<h2 dir="auto">Describe the bug</h2>
<p dir="auto">Next 9 does not work in Docker.</p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">Here is my repo:  <a href="https://github.com/WillowHQ/dockerIssue">https://github.com/WillowHQ/dockerIssue</a></p>
<p dir="auto"><code class="notranslate">yarn</code><br>
<code class="notranslate">yarn run build</code><br>
<code class="notranslate">yarn run start</code><br>
Works as expected.</p>
<p dir="auto"><code class="notranslate">docker build -t cgcweb .</code><br>
Sending build context to Docker daemon  1.076MB<br>
Step 1/9 : FROM node:8.9.4<br>
---&gt; 672002a50a0b<br>
Step 2/9 : COPY . .<br>
---&gt; 930ba71436a7<br>
Step 3/9 : RUN rm -rf node_modules<br>
---&gt; Running in 6a02f97d7e04<br>
Removing intermediate container 6a02f97d7e04<br>
---&gt; 417bb64d94c6<br>
Step 4/9 : RUN rm -rf .next<br>
---&gt; Running in fb08b231ad4c<br>
Removing intermediate container fb08b231ad4c<br>
---&gt; 21565ed63d03<br>
Step 5/9 : RUN rm yarn.lock<br>
---&gt; Running in 262dd1b4f4a6<br>
Removing intermediate container 262dd1b4f4a6<br>
---&gt; d4397a346e97<br>
Step 6/9 : RUN yarn install<br>
---&gt; Running in b7432590fedd<br>
yarn install v1.3.2<br>
warning package.json: No license field<br>
info No lockfile found.<br>
warning No license field<br>
[1/4] Resolving packages...<br>
[2/4] Fetching packages...<br>
info fsevents@1.2.9: The platform "linux" is incompatible with this module.<br>
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.<br>
[3/4] Linking dependencies...<br>
[4/4] Building fresh packages...<br>
success Saved lockfile.<br>
Done in 14.75s.<br>
Removing intermediate container b7432590fedd<br>
---&gt; 1f5bc4dd889f<br>
Step 7/9 : RUN yarn run build<br>
---&gt; Running in 4df33457b0f6<br>
yarn run v1.3.2<br>
warning package.json: No license field<br>
$ next build</p>
<blockquote>
<p dir="auto">Build error occurred<br>
{ Error: ENOENT: no such file or directory, stat '/dev/fd/10' errno: -2, code: 'ENOENT', syscall: 'stat', path: '/dev/fd/10' }<br>
error Command failed with exit code 1.<br>
info Visit <a href="https://yarnpkg.com/en/docs/cli/run" rel="nofollow">https://yarnpkg.com/en/docs/cli/run</a> for documentation about this command.<br>
The command '/bin/sh -c yarn run build' returned a non-zero code: 1</p>
</blockquote>
<ol start="2" dir="auto">
<li>Click on '....'</li>
<li>Scroll down to '....'</li>
<li>See error</li>
</ol>
<p dir="auto"><code class="notranslate">docker run -p 3000:3000 -it cgcweb</code></p>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">A clear and concise description of what you expected to happen.<br>
I'd expect Next to work in Docker.</p>
<h2 dir="auto">Screenshots</h2>
<p dir="auto">If applicable, add screenshots to help explain your problem.</p>
<h2 dir="auto">System information</h2>
<ul dir="auto">
<li>OS: MacOS</li>
<li>Node 8.9.4 and 10.13</li>
<li>Version of Next.js: [9.0.1]</li>
</ul>
<h2 dir="auto">Additional context</h2>
<p dir="auto">Add any other context about the problem here.</p>
<h1 dir="auto">Bug report</h1>
<h2 dir="auto">Describe the bug</h2>
<p dir="auto">I have following code inside server.js</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="server.get('/ar/:id', (req, res) =&gt; {
            const queryParams = {id: req.params.id};
            const pagePath = '/artist';
            return ssrCache({req, res, pagePath, queryParams})
        });"><pre class="notranslate"><code class="notranslate">server.get('/ar/:id', (req, res) =&gt; {
            const queryParams = {id: req.params.id};
            const pagePath = '/artist';
            return ssrCache({req, res, pagePath, queryParams})
        });
</code></pre></div>
<p dir="auto">And</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" &lt;Link as={`/ar/${o.id}`} href={`/artist?id=${o.id}`}&gt;"><pre class="notranslate"><code class="notranslate"> &lt;Link as={`/ar/${o.id}`} href={`/artist?id=${o.id}`}&gt;
</code></pre></div>
<p dir="auto">in the ./page/artist.js file. It works properly when build and run locally, but will return<br>
'404 This page could not be found.' when it is deployed with docker container when trying to refresh the pages.</p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">The server.js code is copy paste from ssr-caching example.</p>
<h2 dir="auto">Expected behavior</h2>
<h2 dir="auto">Screenshots</h2>
<p dir="auto">If applicable, add screenshots to help explain your problem.</p>
<h2 dir="auto">System information</h2>
<ul dir="auto">
<li>OS: macOS, Ubuntu 18.04</li>
<li>Browser Chrome</li>
<li>Version of Next.js: [9.0.1]</li>
</ul>
<h2 dir="auto">Additional context</h2>
<p dir="auto">Add any other context about the problem here.</p>