-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14278c7
commit 872e738
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# 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 \ | ||
curl \ | ||
tar \ | ||
gzip \ | ||
cmake \ | ||
ninja-build \ | ||
gcc \ | ||
g++ \ | ||
python3 \ | ||
python3-pip \ | ||
libstdc++-arm-none-eabi-newlib \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Download and install xpack ARM GCC toolchain | ||
RUN ARCH=$(uname -m) && \ | ||
case "$ARCH" in \ | ||
x86_64) DOWNLOAD_URL="https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v13.3.1-1.1/xpack-arm-none-eabi-gcc-13.3.1-1.1-linux-x64.tar.gz";; \ | ||
aarch64) DOWNLOAD_URL="https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v13.3.1-1.1/xpack-arm-none-eabi-gcc-13.3.1-1.1-linux-arm64.tar.gz";; \ | ||
arm*) DOWNLOAD_URL="https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v13.3.1-1.1/xpack-arm-none-eabi-gcc-13.3.1-1.1-linux-arm.tar.gz";; \ | ||
*) echo "Unsupported architecture: $ARCH" && exit 1;; \ | ||
esac && \ | ||
wget -O gcc.tar.gz "$DOWNLOAD_URL" && \ | ||
mkdir -p /opt/arm-gcc && \ | ||
tar -xzf gcc.tar.gz -C /opt/arm-gcc --strip-components=1 && \ | ||
rm gcc.tar.gz && \ | ||
ln -s /opt/arm-gcc/bin/* /usr/local/bin/ | ||
|
||
# Verify installation | ||
RUN arm-none-eabi-gcc --version | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /workspaces/stm32-devops-template | ||
|
||
# Default command for the container | ||
CMD ["bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "Development container for STM32", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
"workspaceFolder": "/workspaces/stm32-devops-template", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-vscode.cmake-tools", | ||
"ms-vscode.cpptools" | ||
] | ||
} | ||
}, | ||
"mounts": [ | ||
"source=${localWorkspaceFolder},target=/workspaces/stm32-devops-template,type=bind" | ||
], | ||
"postCreateCommand": "echo 'Dev environment ready!'" | ||
} |