FROM docker.io/library/ubuntu:22.04

RUN dpkg --add-architecture i386 && \
  apt-get update && apt-get -y dist-upgrade && apt-get -y install \
    build-essential ed \
    gcc-multilib g++-multilib \
    lib32ncurses5-dev lib32z1 \
    zlib1g:i386 libncurses5:i386 \
    libgcc1:i386 libstdc++5:i386

WORKDIR /
COPY mips-decstation.linux-xgcc.gz /
RUN tar -zxvf /mips-decstation.linux-xgcc.gz

WORKDIR /work

COPY . .

ENTRYPOINT ["make"]
CMD ["-C", "code"]
