I'm having troubles making Nexus build inside a Docker container. It fails with error ELOOP: too many symbolic links encountered. Locally the build works fine.
The problem is easy to reproduce using a freshly bootstrapped nexus setup.
Repro
Init nexus with database
➜ nexus-repro npx nexus
✔ What is your preferred package manager? › yarn
✔ Do you want to use a database? (https://prisma.io) … yes
✔ Choose a database › MySQL
4933 ● nexus:cli:create:app Scaffolding project
5 ● nexus:cli:create:app Installing dependencies -- nexusVersion: '0.22.0'
1404 ● nexus:plugin:nexusPluginPrisma 1. Please setup your MySQL and fill in the connection uri in your `prisma/.env` file.
2 ● nexus:plugin:nexusPluginPrisma 2. Run `yarn -s prisma migrate save --experimental` to create your first migration file.
0 ● nexus:plugin:nexusPluginPrisma 3. Run `yarn -s prisma migrate up --experimental` to migrate your database.
1 ● nexus:plugin:nexusPluginPrisma 4. Run `yarn -s prisma generate` to generate the Prisma Client.
0 ● nexus:plugin:nexusPluginPrisma 5. Run `yarn -s ts-node prisma/seed.ts` to seed your database.
1 ● nexus:plugin:nexusPluginPrisma 6. Run `yarn -s dev` to start working.
Add Dockerfile
➜ nexus-repro git:(master) ✗ cat <<EOF >> Dockerfile
FROM node:12
ENV NODE_ENV=production
COPY yarn.lock package.json ./
RUN yarn install --non-interactive --pure-lockfile
COPY tsconfig.json ./
COPY prisma prisma
COPY api api
RUN yarn build
CMD ["run", "start"]
ENTRYPOINT yarn
EOF
Docker build
➜ nexus-repro git:(master) ✗ docker build .
Sending build context to Docker daemon 272.6MB
Step 1/10 : FROM node:12
---> 7a73e56f893c
Step 2/10 : ENV NODE_ENV=production
---> Using cache
---> 5a426b18e54a
Step 3/10 : COPY yarn.lock package.json ./
---> Using cache
---> ee27e73984b8
Step 4/10 : RUN yarn install --non-interactive --pure-lockfile
---> Using cache
---> c7b539e4c00a
Step 5/10 : COPY tsconfig.json ./
---> Using cache
---> e89e6e849fc6
Step 6/10 : COPY prisma prisma
---> Using cache
---> 5628fa610216
Step 7/10 : COPY api api
---> 25dd36eeb32c
Step 8/10 : RUN yarn build
---> Running in 0e54cee281a9
yarn run v1.21.1
$ nexus build
Error: ELOOP: too many symbolic links encountered, stat '//proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/lib/cpp'
at statSync (fs.js:915:3)
at Object.inspectSync [as sync] (/node_modules/fs-jetpack/lib/inspect.js:110:12)
at walkSync (/node_modules/fs-jetpack/lib/utils/tree_walker.js:13:24)
at /node_modules/fs-jetpack/lib/utils/tree_walker.js:22:7
at Array.forEach (<anonymous>)
at walkSync (/node_modules/fs-jetpack/lib/utils/tree_walker.js:21:21)
at /node_modules/fs-jetpack/lib/utils/tree_walker.js:22:7
at Array.forEach (<anonymous>)
at walkSync (/node_modules/fs-jetpack/lib/utils/tree_walker.js:21:21)
at /node_modules/fs-jetpack/lib/utils/tree_walker.js:22:7 {
errno: -40,
syscall: 'stat',
code: 'ELOOP',
path: '//proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/proc/1/cwd/lib/cpp'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command '/bin/sh -c yarn build' returned a non-zero code: 1
I'm having troubles making Nexus build inside a Docker container. It fails with error
ELOOP: too many symbolic links encountered
. Locally the build works fine.The problem is easy to reproduce using a freshly bootstrapped nexus setup.
Repro
Init nexus with database
Add Dockerfile
Docker build