Next.js Discord

Discord Forum

Can't Build a Docker Image 14.2.14

Unanswered
Chartreux posted this in #help-forum
Open in Discord
ChartreuxOP
Can someone tell me how to make a simple Nextjs app from scratch and build it into an Docker image?

I tried and failed several times now 😦

Here are my very simple steps to reproduce my issue:
1 - I made a NEW project using 'npx create-next-app@latest'. I chose Yes for using the app router. Next version 14.2.14
2 - I modified next.config.mjs so it has output: "standalone",
3 - I copied the Dockerfile from https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
4 - I ran 'docker build --no-cache -t containerized-next-app .'
5 - The build failed with this error message...

ERROR [runner 4/8] COPY --from=builder /app/public ./public
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 06839550-f2de-4c9b-b628-98c77bf61aac::wg9bkh3wv8xmsjbozsaz3mqd2: "/app/public": not found

Is the official example Dockerfile incorrect?

0 Replies