Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build Docker image #76697

Open
yassine-zhang opened this issue Mar 1, 2025 · 0 comments
Open

Unable to build Docker image #76697

yassine-zhang opened this issue Mar 1, 2025 · 0 comments
Labels
create-next-app Related to our CLI tool for quickly starting a new Next.js application.

Comments

@yassine-zhang
Copy link

Link to the code that reproduces this issue

https://github.com/yassine-zhang/short-video-extractor-website

To Reproduce

  1. Create the project using bunx create-next-app@latest xxx.
  2. bun install to install the dependencies.
  3. Edit the dockerfile file as follows
FROM oven/bun:alpine as builder

WORKDIR /app

# 复制 package.json 和 bun.lockb 文件,安装依赖
COPY package.json bun.lockb ./
RUN bun install

# # 复制所有文件并构建项目
COPY . .
RUN bun run build

# 生产环境镜像
FROM oven/bun:latest as runner

WORKDIR /app

# 复制构建产物和依赖
COPY --from=builder /app/package.json /app/bun.lockb ./
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules

EXPOSE 3000

CMD ["bun", "run", "start"]

  1. Use this command docker build --no-cache --platform linux/amd64 -t xxx.com/test:latest . Build the image

As you can see below, it stays at the build stage, but I have no problem building locally

Image

Current vs. Expected behavior

I can't build the Docker image successfully now, I don't know how to fix it, tried other package managers, used NextJS versions: 14.2.16, 15.1.7

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 22.12.0
  npm: 10.9.0
  Yarn: 4.0.2
  pnpm: 8.15.3
Relevant Packages:
  next: 15.1.7
  eslint-config-next: 15.1.7
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.8.2
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

create-next-app

Which stage(s) are affected? (Select all that apply)

Other (Deployed)

Additional context

No response

@github-actions github-actions bot added the create-next-app Related to our CLI tool for quickly starting a new Next.js application. label Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
create-next-app Related to our CLI tool for quickly starting a new Next.js application.
Projects
None yet
Development

No branches or pull requests

1 participant