Lightweight Docker image for C unit testing with Ceedling on Alpine Linux.
503
Lightweight Docker image providing Ceedling for C unit testing and Test-Driven Development (TDD) on Alpine Linux.
docker pull safdariali/ceedling:latest
docker run --rm safdariali/ceedling:latest ceedling --version
From the root directory of a Ceedling project:
docker run --rm \
-v "$(pwd):/workspace" \
-w /workspace \
safdariali/ceedling:latest \
ceedling test:all
Mount the project directory to /workspace:
docker run --rm \
-v "$(pwd):/workspace" \
-w /workspace \
safdariali/ceedling:latest \
ceedling test:all
This runs the complete Ceedling test suite.
docker run --rm \
-v "$(pwd):/workspace" \
-w /workspace \
safdariali/ceedling:latest \
ceedling test:test_blink
Replace 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=1
docker run --rm \
-v "$(pwd):/workspace" \
-w /workspace \
safdariali/ceedling:latest \
ceedling new my_project
This 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/sh
docker run --rm safdariali/ceedling:latest ceedling --version
The 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:all
For reproducible CI builds, use a complete image tag:
container:
image: safdariali/ceedling:1.1.2-ruby-4.0.6-alpine-3.24
This prevents a future latest update from changing the test environment unexpectedly.
git clone https://github.com/SafdariAli/ceedling-docker.git
cd ceedling-docker
docker 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 --version
The repository provides scripts for building the image locally.
.\build-ceedling-local.ps1
Custom 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.sh
Custom versions:
./build-ceedling-local.sh \
--CeedlingVersion "1.1.2" \
--RubyVersion "4.0.6" \
--AlpineVersion "3.24"
The local build scripts:
latest tag.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 --version
A 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 --version
For 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:all```
## ๐ฆ Docker Image
The published image is available from Docker Hub:
```text
safdariali/ceedling
Pull the latest version:
docker pull safdariali/ceedling:latest
Pull a specific version:
docker pull safdariali/ceedling:1.1.2-ruby-4.0.6-alpine-3.24
This 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:
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.
If you find this image useful:
Happy Testing with Ceedling! ๐ฑ
Content type
Image
Digest
sha256:6dc82e449โฆ
Size
121.6 MB
Last updated
16 days ago
docker pull safdariali/ceedling