Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dev container config #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "Xinu Build Container",
"image": "ghcr.io/xinu-os/xinu-dev-container:v0.1",
"mounts": [
"source=xinu-bashhistory,target=/commandhistory,type=volume"
]
}
35 changes: 35 additions & 0 deletions xinu-dev-container.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM ubuntu:22.04

LABEL org.opencontainers.image.source="https://github.com/xinu-os/xinu"
LABEL authors="Alex Gebhard"
LABEL maintainer="[email protected]"

RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y autoconf automake autotools-dev curl python3 python3-pip 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 wget xz-utils

WORKDIR /opt/
RUN wget https://ftp.gnu.org/gnu/binutils/binutils-2.42.tar.gz
RUN tar xvzf binutils-2.42.tar.gz
WORKDIR /opt/binutils-2.42/
RUN ./configure --prefix=/opt/mipsel-dev --target=mipsel
RUN make
RUN make install
RUN mkdir -p /opt/mipsel-dev/mipsel/usr
RUN ln -s /usr/include /opt/mipsel-dev/mipsel/usr/include

WORKDIR /opt/
RUN git clone https://github.com/riscv-collab/riscv-gnu-toolchain /opt/riscv-gnu-toolchain --recurse-submodules
WORKDIR /opt/riscv-gnu-toolchain
RUN ./configure --prefix=/opt/riscv
RUN make linux

WORKDIR /opt/
RUN wget https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz
RUN tar xf arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz

RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
&& echo "$SNIPPET" >> "/root/.bashrc"

ENV PATH="${PATH}:/opt/riscv/bin/:/opt/mipsel-dev/bin/:/opt/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin"
CMD ["echo", "Xinu build docker image created!"]