diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..8d96444ec --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,26 @@ +// 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": "Existing Dockerfile", + "build": { + // Sets the run context to one level up instead of the .devcontainer folder. + "context": "..", + // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. + "dockerfile": "../Dockerfile" + } + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Uncomment the next line to run commands after the container is created. + // "postCreateCommand": "cat /etc/os-release", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "devcontainer" +} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..fabc92cca --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM ubuntu:22.04 + +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y make cmake zip curl wget git doxygen graphviz python3 python3-pip ninja-build openssh-server rsync zip cppcheck openocd && \ + wget -O archive.tar.xz "https://developer.arm.com/-/media/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi.tar.xz?rev=dccb66bb394240a98b87f0f24e70e87d&hash=B788763BE143D9396B59AA91DBA056B6" && \ + tar xf archive.tar.xz -C /opt && \ + rm archive.tar.xz && \ + apt-get autoclean -y && \ + apt-get autoremove -y && \ + apt-get clean + +# setup container arm-gcc toolchain paths for cmake +ENV PATH=/opt/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi/bin:$PATH +RUN ln -s /opt/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc /usr/bin/arm-none-eabi-gcc +RUN ln -s /opt/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-g++ /usr/bin/arm-none-eabi-g++ +RUN ln -s /opt/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-ar /usr/bin/arm-none-eabi-ar +RUN ln -s /opt/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-as /usr/bin/arm-none-eabi-as +RUN ln -s /opt/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-size /usr/bin/arm-none-eabi-size +RUN ln -s /opt/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-objcopy /usr/bin/arm-none-eabi-objcopy \ No newline at end of file diff --git a/doc/VSCode_DevContainer.md b/doc/VSCode_DevContainer.md new file mode 100644 index 000000000..0b4c6e240 --- /dev/null +++ b/doc/VSCode_DevContainer.md @@ -0,0 +1,34 @@ +# VSCode Dev Container development + +A Dockerfile has been added, which contains a complete development environment that is consistent across all operating systems supporting Docker. + +When VSCode encounters a `.devcontainer` directory, it will prompt you to open the workspace inside a [DevContainer](https://code.visualstudio.com/docs/devcontainers/containers). The entire build system is defined by the *DockerFile*, + +## Initial Setup +1. Install all [prerequisites](##prerequisites) +2. Open `hellow_world.code-workspace` in VSCode. You may be prompted to open the workspace in a dev container - select **Reopen In Container**. This will build and start the docker contain, then reopen VSCode *inside* the container. + + ![Alt text](images/dev_container_prompt.png) + + After VSCOde is running inside the container, the lower left corner of VSCode wil look something like this: + + ![Alt text](images/env_devContainer.png) +3. Your environment is all setup, continue with instructions from development-environment.md + +## Prerequisites + +### MS Windows based development + +* [Docker Desktop](https://www.docker.com/products/docker-desktop/) +* WSL 2 +* VSCode +* VSCode Extension : Dev Containers - Microsoft +* VSCode Extension : C++ Extension Pack - Microsoft +* VSCode Extension : CMake - twxs (optional - CMake syntax highliting) + +### Linux based development +* Docker Desktop +* VSCode +* VSCode Extension : Dev Containers - Microsoft +* VSCode Extension : C++ Extension Pack - Microsoft +* VSCode Extension : CMake - twxs (optional - CMake syntax highliting) \ No newline at end of file diff --git a/doc/images/dev_container_prompt.png b/doc/images/dev_container_prompt.png new file mode 100644 index 000000000..a5ac7ad10 Binary files /dev/null and b/doc/images/dev_container_prompt.png differ diff --git a/doc/images/env_devContainer.png b/doc/images/env_devContainer.png new file mode 100644 index 000000000..0f72fa85d Binary files /dev/null and b/doc/images/env_devContainer.png differ