From 4d587552316c828140e0f3ce5b3d87799335fa66 Mon Sep 17 00:00:00 2001 From: davidcb98 Date: Tue, 25 Mar 2025 18:39:17 +0100 Subject: [PATCH] Added Dockerfile V1 --- Dockerfile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000000..67cccf26465 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +# Docker to build +FROM ubuntu:22.04 AS builder + +RUN apt-get update && apt-get install -y autoconf automake autotools-dev curl python3 python3-pip python3-tomli libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build git cmake libglib2.0-dev libslirp-dev + +RUN mkdir -p /home/app + +WORKDIR /home/app + +RUN git clone https://github.com/riscv-collab/riscv-gnu-toolchain.git + +WORKDIR /home/app/riscv-gnu-toolchain +RUN git checkout 2025.01.20 +RUN sed -i '/shallow = true/d' .gitmodules +RUN sed -i 's/--depth 1//g' Makefile.in +RUN ./configure --prefix=/opt/riscv --with-arch=rv64gc --with-abi=lp64d +RUN make linux -j 4 + +# Clean +#RUN rm -rf /home/app + + +# Final docker +FROM ubuntu:22.04 + +RUN apt-get update && apt-get install -y autoconf automake autotools-dev curl python3 python3-pip python3-tomli libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build git cmake libglib2.0-dev libslirp-dev + +COPY --from=builder /opt/ /opt/ + +ENV PATH="$PATH:/opt/riscv/bin" + +