30 lines
1.1 KiB
Docker
30 lines
1.1 KiB
Docker
FROM rust:latest
|
|
|
|
# Install system dependencies and tools
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
nodejs \
|
|
npm \
|
|
tar \
|
|
gzip \
|
|
curl \
|
|
mingw-w64 \
|
|
&& rm -rf /var/lib/apt/lists/* && \
|
|
# Check if /bin/tar is BusyBox and replace it with GNU tar
|
|
if /bin/tar --version 2>&1 | grep -q "BusyBox"; then \
|
|
cp /usr/bin/tar /bin/tar.gnu && \
|
|
rm -f /bin/tar && \
|
|
mv /bin/tar.gnu /bin/tar; \
|
|
fi
|
|
|
|
# Install sccache for Rust compilation caching
|
|
RUN SCCACHE_VERSION=0.7.4 && \
|
|
SCCACHE_URL="https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz" && \
|
|
curl -L "$SCCACHE_URL" | tar xz && \
|
|
chmod +x sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl/sccache && \
|
|
mv sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl/sccache /usr/local/bin/ && \
|
|
rm -rf sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl
|
|
|
|
# Install cargo-zigbuild for cross-compilation (macOS targets)
|
|
RUN cargo install cargo-zigbuild && \
|
|
rm -rf /usr/local/cargo/registry |