Skip to content

Commit

Permalink
Basic NCS implementation
Browse files Browse the repository at this point in the history
* Essentially replace Zephyr SDK w/ NCS SDK

* Basic README
  • Loading branch information
beriberikix authored Dec 25, 2023
1 parent 580469a commit ce1a6b3
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 2 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: NCS development containers

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
base:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

strategy:
matrix:
sdk: [v2.5.0]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3

- name: Log into GitHub Container Registry
# if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push base image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
file: ./ncs/Dockerfile
# push: ${{ github.event_name != 'pull_request' }}
push: true
platforms: linux/amd64
provenance: false
tags: ghcr.io/${{ github.repository_owner }}/ncs:${{ matrix.sdk }}SDK
build-args: |
NCS_SDK_VERSION=${{ matrix.sdk }}
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
# ncs
Performance-optimized container images for building Nordic nRF Connect SDK applications.
# NCS Container Images

Develop nRF Connect SDK (NCS) applications using OCI-compatible Docker images.

# Getting container images

## Build images locally

Building images locally ensures you can trust the source of the image, as well as allow you to modify the container image configuration.

### Building with Docker CLI

_Build the image_

```
docker build --build-arg NCS_SDK_VERSION=v2.5.0 -f "./ncs/Dockerfile" -t ncs:v2.5.0SDK "./ncs"
```
48 changes: 48 additions & 0 deletions ncs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM debian:stable-slim

ARG NCS_SDK_VERSION=v2.5.0

# OS dependencies and packages

RUN \
apt-get -y update \
&& apt-get -y install --no-install-recommends \
ca-certificates \
cmake \
device-tree-compiler \
git \
ninja-build \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# NCS SDK

RUN \
apt-get -y update \
&& apt-get -y install --no-install-recommends \
wget \
&& wget https://developer.nordicsemi.com/.pc-tools/nrfutil/x64-linux/nrfutil \
&& chmod +x nrfutil \
&& mv nrfutil /usr/bin \
&& nrfutil install toolchain-manager \
&& nrfutil toolchain-manager install --ncs-version ${NCS_SDK_VERSION} \
&& apt-get remove -y --purge \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Python

ENV VIRTUAL_ENV=/opt/venv
RUN \
apt-get -y update \
&& apt-get -y install --no-install-recommends \
python3 \
python3-pip \
python3-venv \
&& python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

# West

RUN pip install --no-cache-dir wheel west

0 comments on commit ce1a6b3

Please sign in to comment.