From 8dab45ecfdfa3a2eda7008c77859897d6ffc4f2d Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Wed, 26 Feb 2025 23:10:17 +0000 Subject: [PATCH] build(devcontainer): improve Dev Container development The toolchain and qemu can be built inside the container + running the qemu inside the container Signed-off-by: EnderIce2 --- .devcontainer/Dockerfile | 86 +++++++++++++++++++++++---------- .devcontainer/devcontainer.json | 20 ++++++-- Fennix.code-workspace | 3 +- 3 files changed, 78 insertions(+), 31 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index d861f906..e305463a 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -2,41 +2,44 @@ FROM mcr.microsoft.com/devcontainers/cpp:1-ubuntu-24.04 ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="none" -# Optionally install the cmake for vcpkg COPY ./reinstall-cmake.sh /tmp/ +RUN <" - -# [Optional] Uncomment this section to install additional packages. -# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends +# Update system and set noninteractive env +RUN export DEBIAN_FRONTEND=noninteractive && apt-get update # Required packages for building gcc & binutils -RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && \ - apt-get -y install --no-install-recommends \ +RUN apt-get -y install --no-install-recommends \ build-essential \ bison \ - flex + flex \ + libgmp-dev \ + libmpfr-dev \ + texinfo \ + file \ + sudo # Required packages for building gcc & binutils -RUN wget https://launchpad.net/ubuntu/+archive/primary/+files/autoconf_2.69-11.1_all.deb -O /tmp/autoconf.deb && \ - sudo dpkg --force-all -i /tmp/autoconf.deb +RUN <> /etc/profile +EOF diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 640423b4..ca18cc6c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,7 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/cpp { - "name": "C++", + "name": "Fennix", "build": { "dockerfile": "Dockerfile" }, @@ -17,11 +17,23 @@ "vivaxy.vscode-conventional-commits", "webfreak.debug", "maziac.asm-code-lens", - "Seven1bit.vscode-ext-ansi-color-highlight" + "Seven1bit.vscode-ext-ansi-color-highlight", + "ms-vsliveshare.vsliveshare", + "maziac.hex-hover-converter", + "ms-vscode.makefile-tools" ] } - } - + }, + // From this line below are for qemu, so not that important. + "mounts": [ + "source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached", + "source=${localEnv:XAUTHORITY},target=/home/vscode/.Xauthority,type=bind,consistency=cached", + "source=/dev/kvm,target=/dev/kvm,type=bind,consistency=cached", + "source=/run/user/1000/pulse/native,target=/run/user/1000/pulse/native,type=bind,consistency=cached" + ], + "runArgs": [ + "--privileged" + ] // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, diff --git a/Fennix.code-workspace b/Fennix.code-workspace index 78524d8b..d7fa1feb 100644 --- a/Fennix.code-workspace +++ b/Fennix.code-workspace @@ -12,7 +12,8 @@ "C_Cpp.autoAddFileAssociations": false, "conventionalCommits.scopes": [ "initrd", - "tools" + "tools", + "devcontainer" ] } }