Skip to content

Commit 9fde862

Browse files
committed
improved build model
1 parent cacaf10 commit 9fde862

File tree

4 files changed

+10
-39
lines changed

4 files changed

+10
-39
lines changed

docker/Dockerfile.manylinux_2_28_ARM64

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
FROM quay.io/pypa/manylinux_2_28_aarch64 as base
22

33
WORKDIR /opt
4-
COPY docker/install-basic-deps-manylinux.sh .
5-
RUN bash /opt/install-basic-deps-manylinux.sh
64

5+
RUN --mount=type=bind,source=docker/install-basic-deps-manylinux.sh,target=/opt/install-basic-deps-manylinux.sh bash /opt/install-basic-deps-manylinux.sh
76
ENV PATH="/root/.cargo/bin:/opt/python/cp310-cp310/bin:/opt/python/cp312-cp312/bin:$PATH"
7+
RUN --mount=type=bind,source=docker/install-basic-deps.sh,target=/opt/install-basic-deps.sh bash /opt/install-basic-deps.sh
88

99
FROM base as chef
1010
ENV PATH="/root/.cargo/bin:$PATH"

docker/Dockerfile.manylinux_2_28_X64

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
FROM quay.io/pypa/manylinux_2_28_x86_64 as base
22

33
WORKDIR /opt
4-
COPY docker/install-basic-deps-manylinux.sh .
5-
RUN bash /opt/install-basic-deps-manylinux.sh
64

5+
RUN --mount=type=bind,source=docker/install-basic-deps-manylinux.sh,target=/opt/install-basic-deps-manylinux.sh bash /opt/install-basic-deps-manylinux.sh
76
ENV PATH="/root/.cargo/bin:/opt/python/cp310-cp310/bin:/opt/python/cp312-cp312/bin:$PATH"
7+
RUN --mount=type=bind,source=docker/install-basic-deps.sh,target=/opt/install-basic-deps.sh bash /opt/install-basic-deps.sh
88

99
FROM base as chef
1010
ENV PATH="/root/.cargo/bin:$PATH"

docker/Dockerfile.py313_rust

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
FROM python:3.13
22

33
# Install dependencies needed for Rust
4-
RUN apt-get update && apt-get install -y \
4+
RUN --mount=type=cache,target=/var/lib/apt/lists \
5+
apt-get update && apt-get install -y \
56
build-essential \
67
pkg-config \
78
curl \
8-
git \
9-
&& apt-get clean \
10-
&& rm -rf /var/lib/apt/lists/*
9+
git
1110

1211
WORKDIR /opt
13-
COPY docker/install-basic-deps-manylinux.sh .
14-
RUN bash /opt/install-basic-deps-manylinux.sh
12+
13+
RUN --mount=type=bind,source=docker/install-basic-deps.sh,target=/opt/install-basic-deps.sh bash /opt/install-basic-deps.sh

docker/install-basic-deps-manylinux.sh

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,6 @@
33
set -e
44

55
dnf install -y epel-release
6-
# dnf config-manager --set-enabled crb
76
dnf install -y --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm
87
dnf install -y --nogpgcheck https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm
9-
dnf install -y ffmpeg ffmpeg-devel clang clang-devel openssl-devel jq
10-
pip3 install maturin==1.8.7 patchelf cffi ziglang sccache>=0.4.0
11-
12-
curl -o rustup.sh --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs
13-
sh rustup.sh -y
14-
source $HOME/.cargo/env
15-
rustup update
16-
rustc -V
17-
18-
cargo install cargo-chef --locked
19-
20-
ARCH=$(uname -m)
21-
22-
PB_REL="https://github.com/protocolbuffers/protobuf/releases"
23-
24-
# x86_64
25-
if [ "$ARCH" = "x86_64" ]; then
26-
curl -LO $PB_REL/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip
27-
elif [ "$ARCH" = "aarch64" ]; then
28-
curl -LO $PB_REL/download/v3.15.8/protoc-3.15.8-linux-aarch_64.zip
29-
else
30-
echo "Unsupported architecture $ARCH"
31-
exit 1
32-
fi
33-
34-
unzip *.zip
35-
cp bin/protoc /usr/bin
36-
chmod 755 /usr/bin/protoc
8+
RUN dnf install -y ffmpeg ffmpeg-devel clang clang-devel openssl-devel jq

0 commit comments

Comments
 (0)