This commit is contained in:
62
build-base/CLAUDE.md
Normal file
62
build-base/CLAUDE.md
Normal file
@ -0,0 +1,62 @@
|
||||
# CLAUDE.md
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
## Project Overview
|
||||
|
||||
This repository contains the build configuration for `dropshell-build-base`, a Docker base image that provides a comprehensive C++ development environment specifically tailored for building applications with the Drogon web framework and multiple database backends.
|
||||
|
||||
## Key Commands
|
||||
|
||||
### Building the Docker Image
|
||||
```bash
|
||||
./build.sh
|
||||
```
|
||||
This builds the Docker image and tags it as `gitea.jde.nz/public/dropshell-build-base:latest`.
|
||||
|
||||
### Manual Docker Build
|
||||
```bash
|
||||
docker build -t gitea.jde.nz/public/dropshell-build-base:latest -f Dockerfile.dropshell-build-base .
|
||||
```
|
||||
|
||||
## Architecture and Design
|
||||
|
||||
### Purpose
|
||||
This base image is designed to create statically-linked C++ executables using:
|
||||
- Alpine Linux with musl libc for minimal container size
|
||||
- All libraries built with static linking (`--enable-static --disable-shared`)
|
||||
- Comprehensive database support (PostgreSQL, MySQL/MariaDB, SQLite3)
|
||||
- Modern C++ web framework (Drogon) with async capabilities
|
||||
|
||||
### Key Components Built from Source
|
||||
1. **c-ares** (1.34.5) - Async DNS resolution
|
||||
2. **OpenSSL** (3.3.0) - Built with musl, configured for static linking
|
||||
3. **jsoncpp** (1.9.6) - JSON parsing
|
||||
4. **PostgreSQL libpq** (16.2) - PostgreSQL client library
|
||||
5. **cURL** (8.7.1) - HTTP client with OpenSSL support
|
||||
6. **MariaDB Connector/C** (3.4.5) - MySQL/MariaDB client
|
||||
7. **SQLite3** (3.45.0) - Embedded database
|
||||
8. **MySQL client** (8.0.36) - MySQL client library
|
||||
9. **Drogon** (latest from git) - C++ web framework
|
||||
|
||||
### Build Characteristics
|
||||
- All libraries installed in `/usr/local/` with specific prefixes
|
||||
- Position Independent Code (`-fPIC`) enabled for static linking
|
||||
- CMake configured to prefer static libraries (`.a` suffix)
|
||||
- Drogon built with PostgreSQL, MySQL, and SQLite3 support enabled
|
||||
|
||||
### Important Paths
|
||||
- OpenSSL: `/usr/local/openssl-musl/`
|
||||
- PostgreSQL: `/usr/local/pgsql/`
|
||||
- MariaDB Connector: `/usr/local/mariadb-connector-c/`
|
||||
- SQLite3: `/usr/local/sqlite3/`
|
||||
- MySQL: `/usr/local/mysql/`
|
||||
- jsoncpp: `/usr/local/jsoncpp/`
|
||||
- c-ares: `/usr/local/cares/`
|
||||
- cURL: `/usr/local/curl/`
|
||||
|
||||
### Notes for Development
|
||||
- When modifying the Dockerfile, maintain the build order as dependencies are interlinked
|
||||
- The image uses the latest Drogon from git master, not a fixed version
|
||||
- All database libraries are built before Drogon to ensure proper linking
|
||||
- The build uses `make -j$(nproc)` for parallel compilation
|
Reference in New Issue
Block a user