Next.js Discord

Discord Forum

Build command not work (process killed) on Docker build

Unanswered
New Zealand posted this in #help-forum
Open in Discord
New ZealandOP
I tried to dockerize my next.js app. I referred to the Dockerfile script in the link below.
https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile

But it is not working if script includes build command. process is killed at lint check stage (despite no lint error)
#16 [builder 4/4] RUN   if [ -f yarn.lock ]; then yarn build;   elif [ -f package-lock.json ]; then npm run build;   elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build;   else echo "Lockfile not found." && exit 1;   fi
#16 sha256:48591b22acc486236c18123328bf32fe4e0027dd4ec1a93fe03d0cbf5d53579d
#16 0.946 yarn run v1.22.19
#16 0.978 $ next build
#16 1.954 Attention: Next.js now collects completely anonymous telemetry regarding usage.
#16 1.955 This information is used to shape Next.js' roadmap and prioritize features.
#16 1.955 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
#16 1.955 https://nextjs.org/telemetry
#16 1.955 
#16 2.088    â–² Next.js 14.0.4
#16 2.089    - Environments: .env.production, .env
#16 2.090 
#16 2.090    Creating an optimized production build ...
#16 59.12  ✓ Compiled successfully
#16 59.12    Linting and checking validity of types ...
#16 76.95 error Command failed with signal "SIGKILL".
#16 76.95 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
#16 ERROR: executor failed running [/bin/sh -c if [ -f yarn.lock ]; then yarn build;   elif [ -f package-lock.json ]; then npm run build;   elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build;   else echo "Lockfile not found." && exit 1;   fi]: exit code: 1

0 Replies