Nextjs can not be built in Podman
Unanswered
Brown bear posted this in #help-forum
Brown bearOP
When I build the nextjs image with target architecture linux/amd64 on my local machine on m2 chip, it gets stuck. There are no errors reported. I have submitted this bug to nextjs in here: https://github.com/vercel/next.js/issues/67728
i test it using a new nextjs project
there is my containerfile:
i test it using a new nextjs project
npx create-next-app@latestthere is my containerfile:
FROM --platform=linux/amd64 node:18-alpine AS base
FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
RUN npm install
# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build --verbose
# Production image, copy all the files and run next
FROM base AS runner
WORKDIR /app
ENV NODE_ENV production
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=builder /app/public ./public
RUN mkdir .next
RUN chown nextjs:nodejs .next
COPY --from=builder --chown=nextjs:nodejs /app/next.config.mjs ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
USER nextjs
EXPOSE 3000
ENV PORT 3000
# server.js is created by next build from the standalone output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
CMD HOSTNAME="0.0.0.0" node server.js2 Replies
Brown bearOP
I've been stuck on this for a week now. I've tested python , which builds amd64 images properly. So I think maybe this is a nextjs issue.
Can someone help me?😩