Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.git
.github
README.md
LICENSE
38 changes: 21 additions & 17 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Log into GitHub Container Registry
# if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand All @@ -37,13 +37,14 @@ jobs:
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
context: ./zephyr-base
file: ./zephyr-base/Dockerfile
# push: ${{ github.event_name != 'pull_request' }}
push: true
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
provenance: false
tags: ghcr.io/${{ github.repository_owner }}/zephyr:base-${{ matrix.sdk }}SDK
cache-from: type=gha,scope=zephyr-base-${{ matrix.sdk }}
cache-to: type=gha,mode=max,scope=zephyr-base-${{ matrix.sdk }}
build-args: |
ZEPHYR_SDK_VERSION=${{ matrix.sdk }}

Expand Down Expand Up @@ -166,7 +167,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Log into GitHub Container Registry
# if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand All @@ -177,13 +178,14 @@ jobs:
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
context: ./zephyr
file: ./zephyr/Dockerfile
# push: ${{ github.event_name != 'pull_request' }}
push: true
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
provenance: false
tags: ghcr.io/${{ github.repository_owner }}/zephyr:${{ matrix.toolchain.nick }}-${{ matrix.sdk }}SDK
cache-from: type=gha,scope=zephyr-arch-${{ matrix.sdk }}-${{ matrix.toolchain.nick }}
cache-to: type=gha,mode=max,scope=zephyr-arch-${{ matrix.sdk }}-${{ matrix.toolchain.nick }}
build-args: |
BASE_IMAGE=ghcr.io/embeddedcontainers/zephyr:base-${{ matrix.sdk }}SDK
ZEPHYR_SDK_TOOLCHAINS=-t ${{ matrix.toolchain.arch }}
Expand All @@ -210,7 +212,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Log into GitHub Container Registry
# if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand All @@ -221,13 +223,14 @@ jobs:
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
context: ./zephyr
file: ./zephyr/Dockerfile
# push: ${{ github.event_name != 'pull_request' }}
push: true
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
provenance: false
tags: ghcr.io/${{ github.repository_owner }}/zephyr:llvm${{ matrix.sdk }}SDK
tags: ghcr.io/${{ github.repository_owner }}/zephyr:llvm-${{ matrix.sdk }}SDK
cache-from: type=gha,scope=zephyr-llvm-${{ matrix.sdk }}
cache-to: type=gha,mode=max,scope=zephyr-llvm-${{ matrix.sdk }}
build-args: |
BASE_IMAGE=ghcr.io/embeddedcontainers/zephyr:base-${{ matrix.sdk }}SDK
ZEPHYR_SDK_TOOLCHAINS=-l
Expand All @@ -254,7 +257,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Log into GitHub Container Registry
# if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand All @@ -265,13 +268,14 @@ jobs:
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
context: ./zephyr-posix
file: ./zephyr-posix/Dockerfile
# push: ${{ github.event_name != 'pull_request' }}
push: true
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64
provenance: false
tags: ghcr.io/${{ github.repository_owner }}/zephyr:posix-${{ matrix.sdk }}SDK
cache-from: type=gha,scope=zephyr-posix-${{ matrix.sdk }}
cache-to: type=gha,mode=max,scope=zephyr-posix-${{ matrix.sdk }}
build-args: |
BASE_IMAGE=ghcr.io/embeddedcontainers/zephyr:base-${{ matrix.sdk }}SDK
ZEPHYR_SDK_VERSION=${{ matrix.sdk }}
41 changes: 19 additions & 22 deletions zephyr-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,36 @@
# syntax=docker/dockerfile:1.7
FROM debian:stable-slim

ARG ZEPHYR_SDK_VERSION=0.16.4
ARG ZEPHYR_SDK_VERSION=1.0.0
ARG ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-${ZEPHYR_SDK_VERSION}

# OS dependencies and packages

RUN \
ENV VIRTUAL_ENV=/opt/venv
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
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/*
python3 \
python3-pip \
python3-venv \
&& python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

# West

RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked \
pip install wheel west

# Zephyr SDK

RUN \
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
export sdk_file_name="zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-$(uname -m)_minimal.tar.xz" \
&& apt-get -y update \
&& apt-get -y install --no-install-recommends \
Expand All @@ -32,21 +44,6 @@ RUN \
&& apt-get remove -y --purge \
wget \
xz-utils \
&& apt-get autoremove -y \
&& 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
&& rm -rf /var/lib/apt/lists/*
21 changes: 8 additions & 13 deletions zephyr-posix/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
ARG ZEPHYR_SDK_VERSION=0.17.0
# syntax=docker/dockerfile:1.7
ARG ZEPHYR_SDK_VERSION=1.0.0
ARG ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-${ZEPHYR_SDK_VERSION}
ARG BASE_IMAGE="zephyr:base-${ZEPHYR_SDK_VERSION}SDK"

FROM ${BASE_IMAGE}

# OS dependencies and packages

RUN \
apt-get -y update \
&& apt-get -y install --no-install-recommends \
gcc-multilib \
make \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Zephyr SDK
# OS dependencies and Zephyr SDK posix setup

ARG ZEPHYR_SDK_INSTALL_DIR

RUN \
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
apt-get -y update \
&& apt-get -y install --no-install-recommends \
gcc-multilib \
make \
wget \
&& ${ZEPHYR_SDK_INSTALL_DIR}/setup.sh -c \
&& apt-get remove -y --purge \
wget \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
5 changes: 4 additions & 1 deletion zephyr/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# syntax=docker/dockerfile:1.7
ARG ZEPHYR_SDK_VERSION=1.0.0
ARG ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-${ZEPHYR_SDK_VERSION}
ARG ZEPHYR_SDK_TOOLCHAINS="-t arm-zephyr-eabi"
Expand All @@ -10,7 +11,8 @@ FROM ${BASE_IMAGE}
ARG ZEPHYR_SDK_INSTALL_DIR
ARG ZEPHYR_SDK_TOOLCHAINS

RUN \
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
apt-get -y update \
&& apt-get -y install --no-install-recommends \
xz-utils \
Expand All @@ -19,5 +21,6 @@ RUN \
&& apt-get remove -y --purge \
wget \
xz-utils \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
Loading