Skip to content

fix: Remove bun.lock from Dockerfile to fix docker build error#75

Closed
zy9306 wants to merge 1 commit intoericc-ch:masterfrom
zy9306:fix/docker-build
Closed

fix: Remove bun.lock from Dockerfile to fix docker build error#75
zy9306 wants to merge 1 commit intoericc-ch:masterfrom
zy9306:fix/docker-build

Conversation

@zy9306
Copy link
Copy Markdown

@zy9306 zy9306 commented Aug 1, 2025

❯ docker build -t copilot-api .
[+] Building 2.9s (7/12)                                                                          docker:desktop-linux
 => [internal] load .dockerignore                                                                                 0.0s
 => => transferring context: 132B                                                                                 0.0s
 => [internal] load build definition from Dockerfile                                                              0.0s
 => => transferring dockerfile: 644B                                                                              0.0s
 => [internal] load metadata for docker.io/oven/bun:1.2.19-alpine                                                 2.8s
 => [internal] load build context                                                                                 0.0s
 => => transferring context: 2.44kB                                                                               0.0s
 => [builder 1/6] FROM docker.io/oven/bun:1.2.19-alpine@sha256:7dc0e33a62cbc1606d14b07706c3a00ae66e8e9d0e81b8324  0.0s
 => CACHED [builder 2/6] WORKDIR /app                                                                             0.0s
 => ERROR [builder 3/6] COPY ./package.json ./bun.lock ./                                                         0.0s
------
 > [builder 3/6] COPY ./package.json ./bun.lock ./:
------
Dockerfile:4
--------------------
   2 |     WORKDIR /app
   3 |
   4 | >>> COPY ./package.json ./bun.lock ./
   5 |     RUN bun install --frozen-lockfile
   6 |
--------------------
Dockerfile:13
--------------------
  11 |     WORKDIR /app
  12 |
  13 | >>> COPY ./package.json ./bun.lock ./
  14 |     RUN bun install --frozen-lockfile --production --ignore-scripts --no-cache
  15 |
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 7d5f49e2-a915-4404-a1aa-e6cbaf999c02::7mrgt7qucwkbey4f7hszjkm7v: "/bun.lock": not found

@zy9306 zy9306 force-pushed the fix/docker-build branch from ab7689b to 864a637 Compare August 1, 2025 09:48
@longnz
Copy link
Copy Markdown
Contributor

longnz commented Aug 1, 2025

hi @zy9306
Dockerfile is correct, failed build because bun.lock is ignored by .dockerignore
i created a PR here
#76

@zy9306 zy9306 closed this Aug 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants