Skip to content
Clone

build: copy bun from the official image

The rust-deps stage installed bun with the network installer, which fetches
its archive from GitHub releases. That download keeps timing out from this
build environment:

  error: Failed to download bun from
  "https://github.com/oven-sh/bun/releases/latest/download/bun-linux-x64.zip"

so every image build depended on a flaky fetch. Copy the binary out of
oven/bun:1-slim instead.
ZhenYi committed
parent 434aa19 commit 872e73f Browse files

1 file changed

+6 −3

Modified Dockerfile View Dockerfile
@@ -1,4 +1,9 @@
11# syntax=docker/dockerfile:1
2# Bun bundles the web SPA from inside web/build.rs. Take the binary from the
3# official image instead of running the network installer: the installer pulls
4# its archive from GitHub releases, which regularly times out here.
5FROM oven/bun:1-slim AS bun
6
27FROM rust:1-bookworm AS rust-deps
38
49RUN apt-get update && apt-get install -y --no-install-recommends \
@@ -13,9 +18,7 @@
1318 protobuf-compiler \
1419 && rm -rf /var/lib/apt/lists/*
1520
16RUN curl -fsSL https://bun.sh/install | bash
17ENV BUN_INSTALL=/root/.bun
18ENV PATH=$BUN_INSTALL/bin:$PATH
21COPY --from=bun /usr/local/bin/bun /usr/local/bin/bun
1922
2023WORKDIR /build
2124