-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
641cd9e
commit 22fa63f
Showing
6 changed files
with
200 additions
and
1 deletion.
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,3 @@ | ||
FROM ghcr.io/nanoframework/dev-container-freertos-nxp:v1.01 | ||
LABEL org.website="https://nanoframework.net/" | ||
LABEL description="This is dockerfile image for NXP targets" |
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,86 @@ | ||
FROM ubuntu:latest AS downloader | ||
RUN apt-get update \ | ||
&& apt-get -y install --no-install-recommends apt-utils \ | ||
&& apt-get install -y \ | ||
curl \ | ||
xz-utils \ | ||
unzip \ | ||
wget | ||
|
||
RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted | ||
|
||
ARG GCC_VERSION=13.2.rel1 | ||
ARG GCC_URI=https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/$GCC_VERSION/binrel/arm-gnu-toolchain-$GCC_VERSION-x86_64-arm-none-eabi.tar.xz | ||
RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted/gcc \ | ||
&& curl -o /tmp/dc-downloads/gcc-arm.tar.xz $GCC_URI \ | ||
&& xz -d /tmp/dc-downloads/gcc-arm.tar.xz \ | ||
&& tar -xvf /tmp/dc-downloads/gcc-arm.tar -C /tmp/dc-extracted/gcc --strip-components 1 \ | ||
&& rm -rf /tmp/dc-extracted/gcc/share/doc/ /tmp/dc-extracted/gcc/share/gcc-arm-none-eabi/samples/ | ||
|
||
ARG CMAKE_VERSION=3.27.6 | ||
ARG CMAKE_SCRIPT=https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-linux-x86_64.sh | ||
RUN wget $CMAKE_SCRIPT \ | ||
-q -O /tmp/dc-downloads/cmake-install.sh \ | ||
&& chmod u+x /tmp/dc-downloads/cmake-install.sh \ | ||
&& mkdir -p /tmp/dc-extracted/cmake \ | ||
&& /tmp/dc-downloads/cmake-install.sh --skip-license --prefix=/tmp/dc-extracted/cmake \ | ||
&& rm /tmp/dc-downloads/cmake-install.sh | ||
|
||
FROM python:3.10 AS devcontainer | ||
|
||
# Avoid warnings by switching to noninteractive | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# You can set up non-root user | ||
# ARG USERNAME=vscode | ||
# ARG USER_UID=1000 | ||
# ARG USER_GID=$USER_UID | ||
|
||
# Configure apt and install packages | ||
RUN apt-get update \ | ||
&& apt-get -y install --no-install-recommends apt-utils dialog icu-devtools 2>&1 \ | ||
&& apt-get install -y \ | ||
git \ | ||
git-lfs \ | ||
git-svn \ | ||
subversion \ | ||
clang-format \ | ||
curl \ | ||
ninja-build \ | ||
srecord \ | ||
nodejs \ | ||
libffi-dev | ||
|
||
# Create needed directories | ||
RUN mkdir -p /usr/local/bin/gcc | ||
|
||
# Clone libs mbedtls and fatfs etc. | ||
RUN git clone --branch mbedtls-2.28.5 https://github.com/ARMmbed/mbedtls.git --depth 1 ./sources/mbedtls \ | ||
&& git clone --branch R0.15 https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs \ | ||
&& git clone --branch STABLE-2_1_3_RELEASE https://github.com/lwip-tcpip/lwip.git --depth 1 ./sources/lwip | ||
|
||
# Clone FreeRTOS | ||
RUN git clone --branch V10.4.1-kernel-only https://github.com/FreeRTOS/FreeRTOS-Kernel.git --depth 1 ./sources/FreeRTOS \ | ||
&& git clone --branch 5.5.1 https://github.com/ARM-software/CMSIS_5.git --depth 1 ./sources/CMSIS_5 | ||
|
||
# set gcc location | ||
ARG TMP_GCC_PATH=/usr/local/bin/gcc | ||
ENV ARM_GCC_PATH=$TMP_GCC_PATH/bin | ||
|
||
# Copy from our other container | ||
COPY --from=downloader /tmp/dc-extracted/gcc $TMP_GCC_PATH | ||
COPY --from=downloader /tmp/dc-extracted/cmake /usr/bin/cmake | ||
|
||
ENV PATH=/usr/bin/cmake/bin:${PATH} | ||
|
||
# Creating static link python for pyhton3 | ||
RUN ln -fs /usr/bin/python3 /usr/bin/python \ | ||
&& pip3 install pyserial | ||
|
||
# Clean up downloaded files | ||
RUN apt-get autoremove -y \ | ||
&& apt-get clean -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Switch back to dialog for any ad-hoc use of apt-get | ||
ENV DEBIAN_FRONTEND=dialog |
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,48 @@ | ||
{ | ||
"name": "nanoFramework-FreeRTOS-NXP", | ||
// If you prefer, you can use the source files and adjust them where they are located, | ||
// To do this, change the "dockerFile" to use 'Dockerfile.NXP.SRC'. | ||
// This will allow you to customize and build the container source and add anything you may need on top. | ||
"dockerFile": "Dockerfile.FreeRTOS-NXP", | ||
"context": ".", | ||
"mounts": [ | ||
// Bind the Unix socket the Docker daemon listens on by default | ||
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind", | ||
// Keep command history | ||
"source=nano-bashhistory,target=/home/vscode/commandhistory,type=volume", | ||
// OPTIONAL: Mount .azure folder for seamless az cli auth | ||
// "source=${env:HOME}${env:USERPROFILE}/.azure,target=/home/vscode/.azure,type=bind" | ||
], | ||
// Set the *default* container specific settings.json values on container create. | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"cmake.preferredGenerators": [ | ||
"Ninja" | ||
], | ||
"cmake.generator": "Ninja", | ||
"cmake.autoRestartBuild" : true, | ||
"cmake.configureSettings": { | ||
"CMAKE_MAKE_PROGRAM":"/usr/bin/ninja" | ||
}, | ||
"cmake.configureOnOpen": false | ||
}, | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"ms-vsliveshare.vsliveshare-pack", | ||
"streetsidesoftware.code-spell-checker", | ||
"twxs.cmake", | ||
"ms-vscode.cmake-tools", | ||
"xaver.clang-format" | ||
] | ||
} | ||
} | ||
// You can pull all the repos with the latest changes, this is only valid if you are using the ./sources/Dockerfile.All containers | ||
// "postAttachCommand": "/usr/local/git-pull-repos.sh" | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "terraform --version", | ||
// Uncomment to connect as a non-root user. See https: //aka.ms/vscode-remote/containers/non-root. | ||
// ,"remoteUser": "vscode" | ||
} |
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
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,59 @@ | ||
# Copyright (c) .NET Foundation and Contributors | ||
# See LICENSE file in the project root for full license information. | ||
|
||
name: Push Docker image [FreeRTOS-NXP] | ||
|
||
env: | ||
CONTAINER_REPO: ghcr.io | ||
CONTAINER_NAME: dev-container-freertos-nxp | ||
CONTAINER_SOURCE_FILE: .devcontainer/FreeRTOS-NXP/Dockerfile.FreeRTOS-NXP.SRC | ||
CONTAINER_VERSION_FILE: .devcontainer/FreeRTOS-NXP/Dockerfile.FreeRTOS-NXP | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '**Dockerfile.FreeRTOS-NXP' # We only care if the version has changed! | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
if: ${{ vars.PUBLISH_DOCKER_IMAGE == 'true' }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get container version | ||
shell: pwsh | ||
run: | | ||
$dockerfileContent = Get-Content("${{ env.CONTAINER_VERSION_FILE }}") | ||
$dockerfileContent -match '(?<=\:)(?:[v]\d+.\d+)' | ||
$containerVersion = $Matches[0].ToString() | ||
echo "GCR_VERSION=$containerVersion" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
if: ${{ github.event_name != 'pull_request' }} | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.CONTAINER_REPO }} | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and Push Docker Image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: ${{ env.CONTAINER_SOURCE_FILE }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: | | ||
${{ env.CONTAINER_REPO }}/${{ github.repository_owner }}/${{ env.CONTAINER_NAME }}:${{ env.GCR_VERSION }} | ||
${{ env.CONTAINER_REPO }}/${{ github.repository_owner }}/${{ env.CONTAINER_NAME }}:latest |
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