FROM ubuntu:20.04

RUN apt -y update
RUN apt -y upgrade
RUN apt -y install build-essential wget rsync gawk bison sudo python3

ADD ./cross-compiler-build.sh /cross-compiler-build.sh
RUN chmod +x /cross-compiler-build.sh

RUN /cross-compiler-build.sh riscv64-linux arm64
ENV PATH="/opt/cross-compiler/riscv64-linux/bin:${PATH}"

RUN rm /cross-compiler-build.sh
