This project provides a Python script to build a minimal Linux system using T2 System Development Environment (T2 SDE), packaged in a Docker container for easy deployment and dependency management. The script includes options to control CPU usage during the build process.
- Automated T2 SDE build process in an isolated Docker environment.
- Configurable number of CPU cores used for building (via
--jobs
orJOBS
environment variable). - Logging to the
logs
folder on the host machine. - Restart capability via a Bash script.
- Docker: Version 20.x or higher.
- Docker Compose: Version 1.29 or higher.
sudo apt update
sudo apt install docker.io docker-compose -y
sudo systemctl enable docker
sudo systemctl start docker
-
Clone the repository:
git clone https://github.com/username/t2-sde-build.git cd t2-sde-build
-
Verify Docker is installed:
docker --version docker-compose --version
-
Run the build process with Docker Compose (default: half of CPU cores):
docker-compose up
-
To specify the number of CPU cores, set the
JOBS
environment variable indocker-compose.yml
:environment: - PYTHONUNBUFFERED=1 - JOBS=2 # Use 2 CPU cores
Then run:
docker-compose up
-
Alternatively, pass the
--jobs
argument:docker-compose run t2-builder python3 build_t2_iso.py --jobs 2
-
To restart the process, use the script:
chmod +x restart.sh ./restart.sh
-
Logs are saved to the
logs
folder on the host.
- Downloads T2 SDE version 24.6.
- Extracts the archive and configures a minimal system.
- Builds an ISO image within the container, using a configurable number of CPU cores.
t2-sde-build/
│
├── build_t2_iso.py # Python build script
├── Dockerfile # Docker image build file
├── docker-compose.yml # Docker Compose configuration
├── restart.sh # Restart script
├── logs/ # Directory for logs (created automatically)
└── README.md # This file
--jobs
: Command-line argument to set the number of parallel build jobs (e.g.,--jobs 2
). Defaults to half of available CPU cores.JOBS
: Environment variable to override the number of jobs (e.g.,export JOBS=2
).
Example:
export JOBS=2
docker-compose up
- Docker not running: Ensure the Docker service is active (
sudo systemctl status docker
). - Insufficient disk space: Check available disk space for downloading and building.
- Build errors: Review logs in the
logs
folder for troubleshooting.
This project is licensed under the MIT License. See the LICENSE
file for details.
Contributions are welcome! Feel free to submit issues or pull requests with suggestions or fixes.