Thank you for your interest in contributing to the Sourcemation Images repository! This document provides guidelines for contributing and instructions on how to set up your local development environment.
To start contributing, you should have the following tools installed:
dockerorpodmanbashgit
If you want to fix a bug in an existing image or add a new one, you should verify your changes locally using the provided build scripts.
- Navigate to the
containersdirectory:cd containers - Run the build script for a specific image. Set
TEST_IMAGE=trueto run tests after the build andPUSH_IMAGE=falseto prevent pushing to registries:Example forexport TEST_IMAGE=true PUSH_IMAGE=false PUSH_README=false ./build-container.sh <image-name>
kubectl:export TEST_IMAGE=true PUSH_IMAGE=false PUSH_README=false ./build-container.sh kubectl
If you are looking to help with images listed as "Problematic" in the main README.md, follow these steps:
- Identify the image name (e.g.,
activemq). - Try to build it locally using the command above.
- Observe the build or test errors.
- Modify the
Dockerfile,init.sh, orconf.shin the image directory (containers/images/<image-name>) to fix the issue. - Re-run the build script until it passes.
- Create a new directory under
containers/images/using the name of your image. You can usecontainers/images/_template/as a base. - Ensure your
Dockerfileincludesversionandnamelabels. - (Optional) Add
init.shif you need to download assets or modify theDockerfilebefore building. - (Optional) Add
conf.shif you need custom build configurations (e.g., multi-tagging, custom entrypoints). - Add a test file in
containers/tests/test_<image-name>.py. - Add the image name to the list in
.github/workflows/build-manual.yml. - Test it locally as described above.
The conf.sh file is sourced by the build script and can be used to override various build and test parameters. This is preferred over modifying the main build-container.sh script.
Common use cases:
- Multiple Tags: If your image supports multiple base OS or requires specific tags:
DOCKER_TAG_SUFFIX="debian-11" - Custom Entrypoint for Tests: If your image has an entrypoint that interferes with tests (e.g., immediately exits), you can override it:
ENTRYPOINT_CMD="--entrypoint=" - Custom Test Command: Override the command run inside the container during testing:
CONTAINER_RUN_COMMAND="/bin/sh" - Startup Timeout: Increase the time allowed for the container to start:
CONTAINER_STARTUP_TIMEOUT=60
- Fork the repository and create your branch from
main. - Ensure your changes pass local builds and tests.
- Submit a Pull Request with a clear description of your changes.
- Our team will review your PR and provide feedback.
- Follow existing naming conventions for directories and tags.
- Keep
Dockerfiles clean and well-commented where necessary. - Respect the license of the base images and software you are packaging.