You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.1 KiB
51 lines
1.1 KiB
# syntax=docker/dockerfile:1
|
|
FROM ubuntu:kinetic
|
|
ARG uid
|
|
ARG gid
|
|
ARG tag=2023.01.03
|
|
CMD /bin/bash
|
|
RUN apt-get update && apt-get install -y \
|
|
autoconf \
|
|
automake \
|
|
autotools-dev \
|
|
curl \
|
|
python3 \
|
|
libmpc-dev \
|
|
libmpfr-dev \
|
|
libgmp-dev \
|
|
libncurses5-dev \
|
|
gawk \
|
|
build-essential \
|
|
bison \
|
|
flex \
|
|
texinfo \
|
|
gperf \
|
|
libtool \
|
|
patchutils \
|
|
bc \
|
|
zlib1g-dev \
|
|
libexpat-dev \
|
|
git \
|
|
meson \
|
|
nano
|
|
|
|
RUN git clone https://github.com/riscv-collab/riscv-gnu-toolchain /build
|
|
WORKDIR /build
|
|
RUN git checkout ${tag}
|
|
|
|
# Patch the build to include the gdb TUI, this makes debugging inside docker
|
|
# much nicer
|
|
RUN sed -i.bak 's/--disable-gprof/--disable-gprof --enable-tui/' Makefile.in
|
|
RUN ./configure --prefix=/usr/local \
|
|
--with-arch=rv32gc --with-abi=ilp32d --with-abi=ilp32 && \
|
|
make -j $(nproc) && \
|
|
make install && \
|
|
rm -rf /build
|
|
|
|
# groupadd will fail if the GID already exists, as is the case for macOS hosts
|
|
# where "staff" is gid 20. That's ok. We just need the group to exist.
|
|
RUN groupadd --gid ${gid} usergrp ; \
|
|
useradd -ms /bin/bash --uid ${uid} --gid ${gid} user
|
|
USER user
|
|
WORKDIR /project
|