Skip to content

Commit e550a70

Browse files
authored
Work on dev containers (#2250)
***NO_CI***
1 parent 14bb1ca commit e550a70

8 files changed

+91
-57
lines changed

.devcontainer/README.md

-1.95 KB

The available pre build images are:

  • ghcr.io/nanoframework/dev-container-all: contains all elements to build any image. Important: the size of this container is very large, if you are interested only in building one of the image, you better need to une one of the following dedicated image
  • ghcr.io/nanoframework/dev-container-chibios: contains all elements to build any ESP32 image
  • ghcr.io/nanoframework/dev-container-ti: contains all elements to build any ESP32 image
  • ghcr.io/nanoframework/dev-container-esp32: contains all elements to build any ESP32 image
  • ghcr.io/nanoframework/dev-container-azure-rtos: contains all elements to build any Azure RTOS based image
  • ghcr.io/nanoframework/dev-container-all: contains all elements to build a firmware image for any of the targets. Important: the size of this container is very large, if you are interested only in building targets on a single platform, you're better using one of the following images specific to that platform.
  • ghcr.io/nanoframework/dev-container-chibios: contains all elements to build a firmware image for any of the ChibiOS targets
  • ghcr.io/nanoframework/dev-container-ti: contains all elements to build a firmware image for any of the TI SimpleLink targets
  • ghcr.io/nanoframework/dev-container-esp32: contains all elements to build a firmware image for any of the ESP32 targets
  • ghcr.io/nanoframework/dev-container-azure-rtos: contains all elements to build a firmware image for any of the Azure RTOS targets

To choose the dev container you want to use, adjust devcontainer.json and change the "dockerFile": "Dockerfile" elements for the image you'd liked to use:

  • Dockerfile.All to use the pre build container with all the elements to build all the images
  • Dockerfile.All to use the pre build container with all the elements to build a firmware image for any of the targets
  • Dockerfile.AzureRTOS to use the pre build container with all the elements to build Azure RTOS based devicestargets
  • Dockerfile.ChibiOS to use the pre build container with all the elements to build ChibiOS based devicestargets
  • Dockerfile.ESP32 to use the pre build container with all the elements to build ESP32 based devicestargets
  • Dockerfile.TI to use the pre build container with all the elements to build TI based devicesSimpleLink targets
  • ./sources/Dockerfile.All to use build the container image from the source with all the elements to build all the images
  • ./sources/Dockerfile.AzureRTOS to use build the container image from the source with all the elements to build Azure RTOS based devices
  • ./sources/Dockerfile.ChibiOS to use build the container image from the source with all the elements to build ChibiOS based devices
  • ./sources/Dockerfile.ESP32 to use build the container image from the source with all the elements to build ESP32 based devices
  • ./sources/Dockerfile.TI to use build the container image from the source with all the elements to build TI SimpleLink based devices

.devcontainer/sources/Dockerfile.ESP32

-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ RUN mkdir -p /usr/local/bin/gcc
4747
# Clone mbedtls and fatfs
4848
RUN git clone --branch mbedtls-2.28.0 https://github.com/ARMmbed/mbedtls.git --depth 1 ./sources/mbedtls \
4949
&& git clone --branch R0.14 https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs
50-
# Clone FreeRTOS and what is needed for ESP32
51-
RUN git clone --branch V10.4.1-kernel-only https://github.com/FreeRTOS/FreeRTOS-Kernel.git --depth 1 ./sources/FreeRTOS \
52-
&& git clone --branch 5.5.1 https://github.com/ARM-software/CMSIS_5.git --depth 1 ./sources/CMSIS_5 \
53-
&& git clone --branch nf-build https://github.com/nanoframework/spiffs.git --depth 1 ./sources/spiffs
5450

5551
# Clone ESP-IDF
5652
RUN git clone --branch v4.4 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf

.devcontainer/sources/Dockerfile.TI

-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ RUN apt-get update \
4747
RUN mkdir -p /usr/local/bin/gcc \
4848
&& mkdir -p /usr/local/bin/titools
4949

50-
# Clone mbedtls and fatfs
51-
RUN git clone --branch mbedtls-2.28.0 https://github.com/ARMmbed/mbedtls.git --depth 1 ./sources/mbedtls \
52-
&& git clone --branch R0.14 https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs
5350
# Clone what is needed for TI
5451
RUN git clone --branch 4.10.00.07 https://github.com/nanoframework/SimpleLink_CC32xx_SDK.git --depth 1 ./sources/SimpleLinkCC32 \
5552
# you can't use the nanoFramework repository as it's Windows only
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
1-
name: Build and push image for all RTOS
1+
# Copyright (c) .NET Foundation and Contributors
2+
# See LICENSE file in the project root for full license information.
3+
4+
name: Build Dev Container for all platforms
25

36
env:
47
GCR_IMAGE: ghcr.io/nanoframework/dev-container-all
5-
GCR_VERSION: v2.6
68
GCR_FILE: .devcontainer/sources/Dockerfile.All
79

8-
# Controls when the action will run.
910
on:
10-
# Triggers the workflow on push or pull request events but only for the main branch
1111
push:
1212
branches: [ develop ]
1313
paths: [ .devcontainer/sources/Dockerfile.All ]
1414

15-
# Allows you to run this workflow manually from the Actions tab
1615
workflow_dispatch:
1716

18-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1917
jobs:
20-
# This workflow contains a single job called "build"
2118
build:
22-
# The type of runner that the job will run on
2319
runs-on: ubuntu-latest
2420
steps:
25-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
21+
2622
- name: Checkout Repository
2723
uses: actions/checkout@v2
2824

25+
- name: Read docker file content
26+
id: read_dockerfile
27+
uses: andstor/file-reader-action@v1
28+
with:
29+
path: '.devcontainer/Dockerfile.All'
30+
31+
- name: Get container version
32+
run: |
33+
$dockerfileContent = "${ steps.read_dockerfile.outputs.contents }"
34+
$dockerfileContent -match '(?<=\:v)(?:\d+.\d+)'
35+
echo "GCR_VERSION=$Matches[0]" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
36+
2937
- name: Login to GitHub Container Registry
3038
uses: docker/login-action@v1
3139
with:
@@ -40,4 +48,4 @@ jobs:
4048
push: true # Will only build if this is not here
4149
tags: |
4250
${{ env.GCR_IMAGE }}:${{ env.GCR_VERSION }}
43-
${{ env.GCR_IMAGE }}:latest
51+
${{ env.GCR_IMAGE }}:latest
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
1-
name: Build and push image for Azure RTOS
1+
# Copyright (c) .NET Foundation and Contributors
2+
# See LICENSE file in the project root for full license information.
3+
4+
name: Build Dev Container for Azure RTOS
25

36
env:
47
GCR_IMAGE: ghcr.io/nanoframework/dev-container-azure-rtos
5-
GCR_VERSION: v1.1
68
GCR_FILE: .devcontainer/sources/Dockerfile.AzureRTOS
79

8-
# Controls when the action will run.
910
on:
10-
# Triggers the workflow on push or pull request events but only for the main branch
1111
push:
1212
branches: [ develop ]
1313
paths: [ .devcontainer/sources/Dockerfile.AzureRTOS ]
1414

15-
# Allows you to run this workflow manually from the Actions tab
1615
workflow_dispatch:
1716

18-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1917
jobs:
20-
# This workflow contains a single job called "build"
2118
build:
22-
# The type of runner that the job will run on
2319
runs-on: ubuntu-latest
2420
steps:
25-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
21+
2622
- name: Checkout Repository
2723
uses: actions/checkout@v2
2824

25+
- name: Read docker file content
26+
id: read_dockerfile
27+
uses: andstor/file-reader-action@v1
28+
with:
29+
path: '.devcontainer/Dockerfile.AzureRTOS'
30+
31+
- name: Get container version
32+
run: |
33+
$dockerfileContent = "${ steps.read_dockerfile.outputs.contents }"
34+
$dockerfileContent -match '(?<=\:v)(?:\d+.\d+)'
35+
echo "GCR_VERSION=$Matches[0]" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
36+
2937
- name: Login to GitHub Container Registry
3038
uses: docker/login-action@v1
3139
with:
@@ -40,4 +48,5 @@ jobs:
4048
push: true # Will only build if this is not here
4149
tags: |
4250
${{ env.GCR_IMAGE }}:${{ env.GCR_VERSION }}
43-
${{ env.GCR_IMAGE }}:latest
51+
${{ env.GCR_IMAGE }}:latest
52+
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
1-
name: Build and push ChibiOS image
1+
# Copyright (c) .NET Foundation and Contributors
2+
# See LICENSE file in the project root for full license information.
3+
4+
name: Build Dev Container for ChibiOS
25

36
env:
47
GCR_IMAGE: ghcr.io/nanoframework/dev-container-chibios
5-
GCR_VERSION: v1.3
68
GCR_FILE: .devcontainer/sources/Dockerfile.ChibiOS
79

8-
# Controls when the action will run.
910
on:
10-
# Triggers the workflow on push or pull request events but only for the main branch
1111
push:
1212
branches: [ develop ]
1313
paths: [ .devcontainer/sources/Dockerfile.ChibiOS ]
1414

15-
# Allows you to run this workflow manually from the Actions tab
1615
workflow_dispatch:
1716

18-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1917
jobs:
20-
# This workflow contains a single job called "build"
2118
build:
22-
# The type of runner that the job will run on
2319
runs-on: ubuntu-latest
2420
steps:
25-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
21+
2622
- name: Checkout Repository
2723
uses: actions/checkout@v2
2824

25+
- name: Read docker file content
26+
id: read_dockerfile
27+
uses: andstor/file-reader-action@v1
28+
with:
29+
path: '.devcontainer/Dockerfile.ChibiOS'
30+
31+
- name: Get container version
32+
run: |
33+
$dockerfileContent = "${ steps.read_dockerfile.outputs.contents }"
34+
$dockerfileContent -match '(?<=\:v)(?:\d+.\d+)'
35+
echo "GCR_VERSION=$Matches[0]" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
36+
2937
- name: Login to GitHub Container Registry
3038
uses: docker/login-action@v1
3139
with:
@@ -40,4 +48,4 @@ jobs:
4048
push: true # Will only build if this is not here
4149
tags: |
4250
${{ env.GCR_IMAGE }}:${{ env.GCR_VERSION }}
43-
${{ env.GCR_IMAGE }}:latest
51+
${{ env.GCR_IMAGE }}:latest
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
1-
name: Build and push ESP32 image
1+
# Copyright (c) .NET Foundation and Contributors
2+
# See LICENSE file in the project root for full license information.
3+
4+
name: Build Dev Container for ESP32
25

36
env:
47
GCR_IMAGE: ghcr.io/nanoframework/dev-container-esp32
5-
GCR_VERSION: v2.5
68
GCR_FILE: .devcontainer/sources/Dockerfile.ESP32
79

8-
# Controls when the action will run.
910
on:
10-
# Triggers the workflow on push or pull request events but only for the main branch
1111
push:
1212
branches: [ develop ]
1313
paths: [ .devcontainer/sources/Dockerfile.ESP32 ]
1414

15-
# Allows you to run this workflow manually from the Actions tab
1615
workflow_dispatch:
1716

18-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1917
jobs:
20-
# This workflow contains a single job called "build"
2118
build:
22-
# The type of runner that the job will run on
2319
runs-on: ubuntu-latest
2420
steps:
25-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
21+
2622
- name: Checkout Repository
2723
uses: actions/checkout@v2
2824

25+
- name: Read docker file content
26+
id: read_dockerfile
27+
uses: andstor/file-reader-action@v1
28+
with:
29+
path: '.devcontainer/Dockerfile.ESP32'
30+
31+
- name: Get container version
32+
run: |
33+
$dockerfileContent = "${ steps.read_dockerfile.outputs.contents }"
34+
$dockerfileContent -match '(?<=\:v)(?:\d+.\d+)'
35+
echo "GCR_VERSION=$Matches[0]" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
36+
2937
- name: Login to GitHub Container Registry
3038
uses: docker/login-action@v1
3139
with:
@@ -40,4 +48,4 @@ jobs:
4048
push: true # Will only build if this is not here
4149
tags: |
4250
${{ env.GCR_IMAGE }}:${{ env.GCR_VERSION }}
43-
${{ env.GCR_IMAGE }}:latest
51+
${{ env.GCR_IMAGE }}:latest
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
1-
name: Build and push image for TI
1+
# Copyright (c) .NET Foundation and Contributors
2+
# See LICENSE file in the project root for full license information.
3+
4+
name: Build Dev Container for TI
25

36
env:
47
GCR_IMAGE: ghcr.io/nanoframework/dev-container-ti
5-
GCR_VERSION: v1.2
68
GCR_FILE: .devcontainer/sources/Dockerfile.TI
79

8-
# Controls when the action will run.
910
on:
10-
# Triggers the workflow on push or pull request events but only for the main branch
1111
push:
1212
branches: [ develop ]
1313
paths: [ .devcontainer/sources/Dockerfile.TI ]
1414

15-
# Allows you to run this workflow manually from the Actions tab
1615
workflow_dispatch:
1716

18-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1917
jobs:
20-
# This workflow contains a single job called "build"
2118
build:
22-
# The type of runner that the job will run on
2319
runs-on: ubuntu-latest
2420
steps:
25-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
21+
2622
- name: Checkout Repository
2723
uses: actions/checkout@v2
2824

25+
- name: Read docker file content
26+
id: read_dockerfile
27+
uses: andstor/file-reader-action@v1
28+
with:
29+
path: '.devcontainer/Dockerfile.TI'
30+
31+
- name: Get container version
32+
run: |
33+
$dockerfileContent = "${ steps.read_dockerfile.outputs.contents }"
34+
$dockerfileContent -match '(?<=\:v)(?:\d+.\d+)'
35+
echo "GCR_VERSION=$Matches[0]" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
36+
2937
- name: Login to GitHub Container Registry
3038
uses: docker/login-action@v1
3139
with:
@@ -40,4 +48,4 @@ jobs:
4048
push: true # Will only build if this is not here
4149
tags: |
4250
${{ env.GCR_IMAGE }}:${{ env.GCR_VERSION }}
43-
${{ env.GCR_IMAGE }}:latest
51+
${{ env.GCR_IMAGE }}:latest

0 commit comments

Comments
 (0)