mirror of
https://github.com/lukstep/raspberry-pi-pico-docker-sdk.git
synced 2026-03-26 09:25:44 +03:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b59ba8a6a |
57
Dockerfile
57
Dockerfile
@@ -1,26 +1,46 @@
|
|||||||
FROM ubuntu:24.10 AS gcc_build
|
FROM ubuntu:24.04
|
||||||
|
|
||||||
# Build GCC RISC-V
|
|
||||||
COPY ./install_gcc.sh /home/install_gcc.sh
|
|
||||||
RUN bash /home/install_gcc.sh
|
|
||||||
|
|
||||||
FROM ubuntu:24.10 AS sdk_setup
|
|
||||||
|
|
||||||
RUN apt-get update -y && \
|
RUN apt-get update -y && \
|
||||||
apt-get upgrade -y && \
|
apt-get upgrade -y && \
|
||||||
apt-get install --no-install-recommends -y \
|
apt-get install --no-install-recommends -y \
|
||||||
git \
|
build-essential \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
python3 \
|
cmake \
|
||||||
tar \
|
gcc-arm-none-eabi \
|
||||||
build-essential \
|
git \
|
||||||
gcc-arm-none-eabi \
|
libnewlib-arm-none-eabi \
|
||||||
libnewlib-arm-none-eabi \
|
libstdc++-arm-none-eabi-newlib \
|
||||||
libstdc++-arm-none-eabi-newlib \
|
python3 \
|
||||||
cmake && \
|
tar \
|
||||||
|
wget && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# RISC-V toolchain
|
||||||
|
ARG RISCV_VERSION=15.2.0-1
|
||||||
|
ARG TARGETARCH
|
||||||
|
|
||||||
|
RUN if [ "$TARGETARCH" = "arm64" ]; then \
|
||||||
|
ARCH=linux-arm64; \
|
||||||
|
elif [ "$TARGETARCH" = "amd64" ]; then \
|
||||||
|
ARCH=linux-x64; \
|
||||||
|
else \
|
||||||
|
echo "Unsupported arch: $TARGETARCH" && exit 1; \
|
||||||
|
fi && \
|
||||||
|
wget -q https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v${RISCV_VERSION}/xpack-riscv-none-elf-gcc-${RISCV_VERSION}-${ARCH}.tar.gz \
|
||||||
|
-O /tmp/riscv.tar.gz && \
|
||||||
|
tar -xzf /tmp/riscv.tar.gz -C /opt && \
|
||||||
|
rm /tmp/riscv.tar.gz
|
||||||
|
|
||||||
|
# Add toolchain to PATH
|
||||||
|
ENV PATH="/opt/xpack-riscv-none-elf-gcc-${RISCV_VERSION}/bin:${PATH}"
|
||||||
|
|
||||||
|
RUN TOOLCHAIN=/opt/xpack-riscv-none-elf-gcc-${RISCV_VERSION}/bin && \
|
||||||
|
for f in $TOOLCHAIN/riscv-none-elf-*; do \
|
||||||
|
name=$(basename $f | sed 's/riscv-none-elf/riscv32-unknown-elf/'); \
|
||||||
|
ln -s $f /usr/local/bin/$name; \
|
||||||
|
done
|
||||||
|
|
||||||
# Raspberry Pi Pico SDK
|
# Raspberry Pi Pico SDK
|
||||||
ARG SDK_PATH=/usr/local/picosdk
|
ARG SDK_PATH=/usr/local/picosdk
|
||||||
RUN git clone --depth 1 --branch 2.1.1 https://github.com/raspberrypi/pico-sdk $SDK_PATH && \
|
RUN git clone --depth 1 --branch 2.1.1 https://github.com/raspberrypi/pico-sdk $SDK_PATH && \
|
||||||
@@ -46,8 +66,3 @@ RUN git clone --depth 1 --branch 2.1.1 https://github.com/raspberrypi/picotool.g
|
|||||||
make -j$(nproc) && \
|
make -j$(nproc) && \
|
||||||
cmake --install . && \
|
cmake --install . && \
|
||||||
rm -rf /home/picotool
|
rm -rf /home/picotool
|
||||||
|
|
||||||
# Install GCC RISC-V
|
|
||||||
COPY --from=gcc_build /opt/riscv/gcc14-rp2350-no-zcmp /opt/riscv/gcc14-rp2350-no-zcmp
|
|
||||||
ENV PATH="$PATH:/opt/riscv/gcc14-rp2350-no-zcmp/bin"
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user