This directory contains files for building OneFileLinux using Docker, providing a consistent build environment regardless of host system.
- Isolated build environment with all dependencies pre-installed
- Consistent builds across different host platforms (Linux, macOS, Windows)
- Efficient build caching for faster rebuilds
- Proper permission handling between container and host
- Support for all OneFileLinux build options
- Volume mounting for persistent build artifacts
- Easy to use command-line interface
- Docker (Docker Desktop for macOS/Windows, Docker Engine for Linux)
- Docker Compose (included with Docker Desktop or install separately)
- At least 4GB of free memory
- At least 10GB of free disk space
-
Make the build script executable:
chmod +x build-onefilelinux.sh
-
Run the build with default settings:
./build-onefilelinux.sh
-
For a full build with all features:
./build-onefilelinux.sh -b "--full" -
For a minimal build:
./build-onefilelinux.sh -b "--minimal"
You can configure the build by:
- Creating a
.envfile (copy from.env.example) and modifying variables - Using command-line arguments with the
-bor--build-argsoption
Example .env file:
BUILD_ARGS=--minimal --use-cache
HOST_UID=1000
HOST_GID=1000
The build-onefilelinux.sh script supports several options:
Usage: ./build-onefilelinux.sh [options]
Options:
-h, --help Display this help message
-c, --clean Clean the Docker environment before building
-v, --verbose Enable verbose output
-b, --build-args ARG Pass build arguments to the build script
-e, --env-file FILE Specify a custom .env file
-i, --interactive Run in interactive mode (shell inside container)
-p, --pull Pull the latest base image before building
--no-cache Build the Docker image without using cache
Dockerfile: Defines the containerized build environmentdocker-compose.yml: Configuration for Docker Composebuild-onefilelinux.sh: Main build script to interact with the Docker environmententrypoint.sh: Docker container entry point that bootstraps the build processauto-resources.sh: Helper script to automatically detect and configure system resources.env.example: Example environment variable file
After a successful build, the output file (OneFileLinux.efi) will be placed in the ../output/ directory relative to this directory.
If you encounter permission errors, try:
- Ensuring the
HOST_UIDandHOST_GIDare set correctly in the.envfile - Running the build script with the
-coption to clean the environment - Running Docker with appropriate privileges
If the build process runs out of memory:
- Increase Docker's memory allocation in Docker Desktop settings
- Add
DOCKER_MEMORY=8gto your.envfile - Use the
--use-swapbuild option to enable swap inside the build
To improve build performance:
- Use the
--use-cachebuild option (enabled by default) - Increase Docker's CPU allocation
- Use SSD storage for Docker volumes
You can enter an interactive shell in the container for debugging or manual builds:
./build-onefilelinux.sh -iTo run specific build steps:
./build-onefilelinux.sh -i
# Inside the container:
cd /onefilelinux/build
./build.sh get # Only run the download step
./build.sh build # Only run the build stepTo clear the build cache:
./build-onefilelinux.sh -cThis Docker build system can be easily integrated with CI/CD pipelines like GitHub Actions. See the .github/workflows directory for examples.
The Docker build system has been integrated with the standardized library-based build system:
-
Library-Based Build: The Docker entrypoint automatically detects and uses the library system (80-89 range):
80_common.sh: Logging, banners, environment detection81_error_handling.sh: Error handling and prerequisite checks82_build_helper.sh: Docker-specific functions for extraction and file handling83_config_helper.sh: Configuration management
-
Fallback Mode: If the library files are not detected, the system falls back to the legacy build process using build.sh directly
-
Environment Detection: The container automatically marks
IN_DOCKER_CONTAINER=truefor proper environment-specific handling