Lightweight Docker image providing Ceedling for C unit testing and Test-Driven Development (TDD) on Alpine Linux.
The image provides a reproducible environment containing Ceedling, Ruby, and the native C build tools required by Ceedling.
- Features
- Quick Start
- Usage Examples
- Version Tags
- GitHub Actions Integration
- Building from Source
- Local Build Scripts
- Version Management
- License
- Support
- C Unit Testing: Ready-to-use environment for C unit testing with Ceedling
- TDD Ready: Designed for Test-Driven Development workflows
- Embedded Development: Suitable for unit testing embedded C projects
- Lightweight Base: Based on Alpine Linux
- CI/CD Ready: Designed for GitHub Actions and other CI/CD systems
- Self-Contained: Ceedling and required build dependencies are pre-installed
- Testing Frameworks:
- Ceedling
- Unity
- CMock
- CException
- Native C Toolchain:
- GCC
- musl-dev
- GNU Make
- binutils
- Reproducible Builds: Ceedling, Ruby, and Alpine versions are explicitly defined
- Versioned Images: Full image tags identify the Ceedling, Ruby, and Alpine versions
- Automated Version Management: Project infrastructure can detect and track upstream releases
Ceedling itself provides build automation for C projects, including unit-test execution, mocking, test reporting, and integration with C toolchains.
docker pull safdariali/ceedling:latestdocker run --rm safdariali/ceedling:latest ceedling --versionFrom the root directory of a Ceedling project:
docker run --rm \
-v "$(pwd):/workspace" \
-w /workspace \
safdariali/ceedling:latest \
ceedling test:allMount the project directory to /workspace:
docker run --rm \
-v "$(pwd):/workspace" \
-w /workspace \
safdariali/ceedling:latest \
ceedling test:allThis runs the complete Ceedling test suite.
docker run --rm \
-v "$(pwd):/workspace" \
-w /workspace \
safdariali/ceedling:latest \
ceedling test:test_blinkReplace test_blink with the name of the desired test target.
docker run --rm \
-v "$(pwd):/workspace" \
-w /workspace \
safdariali/ceedling:latest \
ceedling test:all VERBOSE=1docker run --rm \
-v "$(pwd):/workspace" \
-w /workspace \
safdariali/ceedling:latest \
ceedling new my_projectThis creates a new Ceedling project in the mounted workspace.
For debugging or inspecting the container environment:
docker run --rm -it \
-v "$(pwd):/workspace" \
-w /workspace \
safdariali/ceedling:latest \
/bin/shdocker run --rm safdariali/ceedling:latest ceedling --versionThe output includes the installed Ceedling version and its bundled testing frameworks.
Each image is published with both a latest tag and a complete version tag.
| Tag | Description | Example |
|---|---|---|
latest |
Latest published image | safdariali/ceedling:latest |
A.B.C-ruby-X.Y.Z-alpine-N.M |
Complete version information | safdariali/ceedling:1.1.2-ruby-4.0.6-alpine-3.24 |
safdariali/ceedling:1.1.2-ruby-4.0.6-alpine-3.24
represents:
Ceedling = 1.1.2
Ruby = 4.0.6
Alpine = 3.24
Using the complete version tag is recommended when reproducibility is important.
The latest tag is intended for users who want the current published image without explicitly selecting component versions.
The image can be used directly as a container in GitHub Actions.
name: C Unit Tests
on:
push:
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
container:
image: safdariali/ceedling:latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Show Ceedling version
run: ceedling --version
- name: Run unit tests
run: ceedling test:allFor reproducible CI builds, use a complete image tag:
container:
image: safdariali/ceedling:1.1.2-ruby-4.0.6-alpine-3.24This prevents a future latest update from changing the test environment unexpectedly.
- Docker
- Git (optional)
git clone https://github.com/SafdariAli/ceedling-docker.git
cd ceedling-dockerdocker build \
--build-arg CEEDLING_VERSION=1.1.2 \
--build-arg RUBY_VERSION=4.0.6 \
--build-arg ALPINE_VERSION=3.24 \
-t safdariali/ceedling:custom \
.docker run --rm \
safdariali/ceedling:custom \
ceedling --versionThe repository provides scripts for building the image locally.
.\build-ceedling-local.ps1Custom versions can be specified:
.\build-ceedling-local.ps1 `
-CeedlingVersion "1.1.2" `
-RubyVersion "4.0.6" `
-AlpineVersion "3.24"chmod +x build-ceedling-local.sh
./build-ceedling-local.shCustom versions:
./build-ceedling-local.sh \
--CeedlingVersion "1.1.2" \
--RubyVersion "4.0.6" \
--AlpineVersion "3.24"The local build scripts:
- Check that Docker is available.
- Validate the Dockerfile.
- Build the image.
- Apply the versioned image tag.
- Apply the
latesttag. - Run a basic Ceedling version test.
The project is designed to keep upstream component versions configurable rather than hard-coded into the Dockerfile.
The main components are:
Ceedling
Ruby
Alpine Linux
Ceedling is distributed as a RubyGem and currently requires Ruby 3.0 or newer.
The Docker image uses the official Ruby Docker image as its base, allowing Ruby and Alpine combinations to be selected through the image tag. The official Ruby image publishes Alpine-based tags such as 4.0.6-alpine3.24.
The project includes automation infrastructure for detecting newer upstream versions and updating the build configuration.
The goal is to make updating the image reproducible while keeping the repository itself minimal.
The image performs a basic installation test during the Docker build:
RUN ceedling --versionA successful image build therefore verifies that Ceedling can be installed and executed inside the container.
After building the image locally, an additional test can be performed:
docker run --rm safdariali/ceedling:latest ceedling --versionFor actual projects, the recommended validation is to mount the project and execute:
docker run --rm \
-v "$(pwd):/workspace" \
-w /workspace \
safdariali/ceedling:latest \
ceedling test:allThe published image is available from Docker Hub:
safdariali/ceedling
Pull the latest version:
docker pull safdariali/ceedling:latestPull a specific version:
docker pull safdariali/ceedling:1.1.2-ruby-4.0.6-alpine-3.24This repository contains Docker packaging and automation for Ceedling.
The Dockerfile, build scripts, documentation, and other original files in this repository are licensed under the MIT License.
The Docker image contains third-party software distributed under their respective licenses, including:
- Ceedling β MIT License
- Ruby β Ruby License / BSD-style terms
- Alpine Linux β various licenses depending on included packages
- GCC β GNU General Public License and related licenses
- binutils β GNU General Public License and related licenses
- musl β MIT License and related licenses
- Unity, CMock, and CException β their respective upstream licenses
The MIT license in this repository applies to the original packaging and automation provided by this project. It does not replace or modify the licenses of the software included in the Docker image.
See the LICENSE file and the respective upstream projects for complete license terms.
- Maintainer: Mohammad Ali Safdari
- Email: m.ali.safdari [at] gmail [dot] com
- GitHub: SafdariAli
- Docker Hub: safdariali
- Issues: Feature requests, bug reports, and suggestions are welcome through GitHub Issues.
If you find this image useful:
- β Star the GitHub repository
- π³ Pull the Docker image
- π’ Share it with your team
Happy Testing with Ceedling! π±