From 8e9b31e2fd4602e8fc8fe4e69071e293a14ffd50 Mon Sep 17 00:00:00 2001 From: Shishir Dey Date: Sat, 30 Nov 2024 12:25:42 +0530 Subject: [PATCH] Add devcontainer configuration --- .devcontainer/devcontainer.json | 19 +++++++++++++++++++ Dockerfile | 28 ++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 Dockerfile diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..4d58cd1 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,19 @@ +{ + "name": "Development container for STM32", + "build": { + "dockerfile": "Dockerfile" + }, + "workspaceFolder": "/workspace", + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cmake-tools", + "ms-vscode.cpptools" + ] + } + }, + "mounts": [ + "source=${localWorkspaceFolder},target=/workspace,type=bind" + ], + "postCreateCommand": "echo 'Dev environment ready!'" +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fa96d60 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +# Use a lightweight base image +FROM ubuntu:20.04 + +# Set environment variables for non-interactive installation +ENV DEBIAN_FRONTEND=noninteractive + +# Update and install required packages +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + software-properties-common \ + wget \ + git \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Download and install arm-none-eabi-gcc +RUN wget -qO- https://developer.arm.com/-/media/Files/downloads/gnu-rm/12.2.rel1/gcc-arm-none-eabi-12.2.rel1-x86_64-linux.tar.bz2 \ + | tar -xj -C /opt/ \ + && ln -s /opt/gcc-arm-none-eabi-12.2.rel1/bin/* /usr/local/bin/ + +# Verify installation +RUN arm-none-eabi-gcc --version + +# Set the working directory inside the container +WORKDIR /workspace + +# Default command for the container +CMD ["bash"]