fix(docker): vendor bun binary for image builds
This commit is contained in:
+6
-4
@@ -1,5 +1,3 @@
|
||||
FROM oven/bun:canary-slim AS bun-bin
|
||||
|
||||
FROM smanx/opencode:latest AS base
|
||||
USER root
|
||||
ARG UBUNTU_APT_MIRROR=mirrors.aliyun.com
|
||||
@@ -11,6 +9,8 @@ ENV PIP_INDEX_URL=${PYPI_INDEX_URL}
|
||||
ENV PIP_TRUSTED_HOST=${PYPI_TRUSTED_HOST}
|
||||
ENV UV_INDEX_URL=${PYPI_INDEX_URL}
|
||||
|
||||
COPY vendor/bun-linux-x64.zip /tmp/bun.zip
|
||||
|
||||
RUN sed -i "s|http://archive.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g; s|http://security.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g" /etc/apt/sources.list 2>/dev/null || true && \
|
||||
sed -i "s|http://archive.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g; s|http://security.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g" /etc/apt/sources.list.d/*.sources 2>/dev/null || true && \
|
||||
apt-get update && apt-get install -y --no-install-recommends \
|
||||
@@ -19,6 +19,10 @@ RUN sed -i "s|http://archive.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g; s|http:/
|
||||
unzip \
|
||||
python3 \
|
||||
python3-venv && \
|
||||
unzip -q /tmp/bun.zip -d /usr/local && \
|
||||
mv /usr/local/bun-linux-x64 /usr/local/bun && \
|
||||
ln -sf /usr/local/bun/bun /usr/local/bin/bun && \
|
||||
rm -f /tmp/bun.zip && \
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh && \
|
||||
ln -s /root/.local/bin/uv /usr/local/bin/uv && \
|
||||
ln -sf /usr/bin/python3 /usr/local/bin/python && \
|
||||
@@ -39,8 +43,6 @@ RUN sed -i "s|http://archive.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g; s|http:/
|
||||
pytest && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=bun-bin /usr/local/bin/bun /usr/local/bin/bun
|
||||
|
||||
FROM base AS deps
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user