Skip to content

Commit 585bbd7

Browse files
committed
initial commit
0 parents  commit 585bbd7

5 files changed

Lines changed: 247 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'Dockerfile.base'
9+
- '.version'
10+
- '.github/workflows/build-and-push.yml'
11+
workflow_dispatch:
12+
13+
jobs:
14+
build-and-push:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Read version
22+
id: version
23+
run: echo "VERSION=$(cat .version)" >> $GITHUB_OUTPUT
24+
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Log in to Docker Hub
29+
uses: docker/login-action@v3
30+
with:
31+
username: ${{ secrets.DOCKERHUB_USERNAME }}
32+
password: ${{ secrets.DOCKERHUB_TOKEN }}
33+
34+
- name: Build and push versioned image
35+
uses: docker/build-push-action@v5
36+
with:
37+
context: .
38+
file: ./Dockerfile.base
39+
push: true
40+
tags: |
41+
getbindu/bindu-runtimebase:${{ steps.version.outputs.VERSION }}
42+
getbindu/bindu-runtimebase:latest
43+
cache-from: type=registry,ref=getbindu/bindu-runtimebase:buildcache
44+
cache-to: type=registry,ref=getbindu/bindu-runtimebase:buildcache,mode=max
45+
46+
- name: Image digest
47+
run: echo "Image pushed successfully with version ${{ steps.version.outputs.VERSION }}"

.version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.0

Dockerfile.base

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM ghcr.io/astral-sh/uv:bookworm AS uv-base
2+
3+
ENV UV_PYTHON_INSTALL_DIR=/python
4+
ENV UV_PYTHON_PREFERENCE=only-managed
5+
6+
RUN uv python install 3.12
7+
8+
FROM node:22-bookworm-slim AS node-base
9+
10+
FROM debian:bookworm-slim
11+
12+
# Install minimal runtime dependencies
13+
RUN apt-get update && apt-get install -y --no-install-recommends \
14+
ca-certificates \
15+
&& rm -rf /var/lib/apt/lists/*
16+
17+
# Copy Python from uv-base
18+
COPY --from=uv-base /python /python
19+
20+
# Copy Node.js from node-base
21+
COPY --from=node-base /usr/local/bin/node /usr/local/bin/
22+
COPY --from=node-base /usr/local/lib/node_modules /usr/local/lib/node_modules
23+
RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \
24+
ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx
25+
26+
# Add Python to PATH (no venv yet, each agent will create its own)
27+
ENV PATH="/python/bin:$PATH"
28+
29+
# OCI labels for base
30+
LABEL org.opencontainers.image.title="bindu-base"
31+
LABEL org.opencontainers.image.description="Base runtime for Bindu agents with Python 3.12 and Node.js 22"
32+
LABEL org.opencontainers.image.authors="raahul dutta <raahul@getbindu.com>"
33+
LABEL org.opencontainers.image.version="1.0.0"
34+
35+
WORKDIR /app

Makefile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
.PHONY: help build push tag-latest all clean
2+
3+
# Configuration
4+
IMAGE_NAME := bindu-base
5+
REGISTRY := raahulrahl/getbindu
6+
VERSION := 1.0.0
7+
FULL_IMAGE := $(REGISTRY)/$(IMAGE_NAME)
8+
9+
help:
10+
@echo "Bindu Base Image - Build & Push"
11+
@echo ""
12+
@echo "Usage:"
13+
@echo " make build Build the Docker image"
14+
@echo " make push Push the versioned image"
15+
@echo " make tag-latest Tag and push as latest"
16+
@echo " make all Build, push versioned, and push latest"
17+
@echo " make clean Remove local images"
18+
@echo ""
19+
@echo "Current version: $(VERSION)"
20+
@echo "Image: $(FULL_IMAGE):$(VERSION)"
21+
22+
build:
23+
@echo "Building $(FULL_IMAGE):$(VERSION)..."
24+
docker build -f Dockerfile.base -t $(FULL_IMAGE):$(VERSION) .
25+
@echo "✓ Build complete"
26+
27+
push: build
28+
@echo "Pushing $(FULL_IMAGE):$(VERSION)..."
29+
docker push $(FULL_IMAGE):$(VERSION)
30+
@echo "✓ Push complete"
31+
32+
tag-latest:
33+
@echo "Tagging $(FULL_IMAGE):$(VERSION) as latest..."
34+
docker tag $(FULL_IMAGE):$(VERSION) $(FULL_IMAGE):latest
35+
docker push $(FULL_IMAGE):latest
36+
@echo "✓ Latest tag pushed"
37+
38+
all: build push tag-latest
39+
@echo "✓ All tasks complete"
40+
41+
clean:
42+
@echo "Removing local images..."
43+
-docker rmi $(FULL_IMAGE):$(VERSION)
44+
-docker rmi $(FULL_IMAGE):latest
45+
@echo "✓ Cleanup complete"

README.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Bindu Runtime Base Image
2+
3+
A minimal, multi-runtime base image for Bindu agents, combining Python 3.12 (via uv) and Node.js 22 on Debian Bookworm.
4+
5+
## Features
6+
7+
- **Python 3.12**: Installed via [uv](https://github.com/astral-sh/uv) for fast, reliable Python management
8+
- **Node.js 22**: Latest LTS version with npm and npx
9+
- **Minimal footprint**: Based on `debian:bookworm-slim` with only essential runtime dependencies
10+
- **Multi-stage build**: Optimized layer caching and smaller final image size
11+
- **OCI compliant**: Proper labels and metadata
12+
13+
## Image Details
14+
15+
- **Base OS**: Debian Bookworm (slim)
16+
- **Python**: 3.12 (managed by uv)
17+
- **Node.js**: 22.x
18+
- **Working Directory**: `/app`
19+
20+
## Usage
21+
22+
### Pull the image
23+
24+
```bash
25+
docker pull ghcr.io/getbindu/bindu-base:latest
26+
# or specific version
27+
docker pull ghcr.io/getbindu/bindu-base:1.0.0
28+
```
29+
30+
### Use as base image
31+
32+
```dockerfile
33+
FROM ghcr.io/getbindu/bindu-base:1.0.0
34+
35+
# Your agent-specific setup
36+
COPY requirements.txt .
37+
RUN pip install -r requirements.txt
38+
39+
COPY package.json .
40+
RUN npm install
41+
42+
# ... rest of your Dockerfile
43+
```
44+
45+
## Building & Publishing
46+
47+
### Prerequisites
48+
49+
- Docker installed and running
50+
- Authenticated to GitHub Container Registry:
51+
```bash
52+
echo $GITHUB_TOKEN | docker login ghcr.io -u USERNAME --password-stdin
53+
```
54+
55+
### Build Commands
56+
57+
```bash
58+
# Build the image
59+
make build
60+
61+
# Build and push versioned image
62+
make push
63+
64+
# Tag and push as latest
65+
make tag-latest
66+
67+
# Build and push both versioned and latest
68+
make all
69+
70+
# Clean up local images
71+
make clean
72+
```
73+
74+
### Version Management
75+
76+
Update the version in `Makefile`:
77+
78+
```makefile
79+
VERSION := 1.0.0 # Change this for new releases
80+
```
81+
82+
## Architecture
83+
84+
The Dockerfile uses a multi-stage build:
85+
86+
1. **uv-base**: Installs Python 3.12 using uv
87+
2. **node-base**: Provides Node.js 22 binaries
88+
3. **Final stage**: Combines both runtimes on minimal Debian base
89+
90+
This approach ensures:
91+
- Clean separation of build dependencies
92+
- Smaller final image (no build tools included)
93+
- Efficient layer caching
94+
95+
## Python Environment
96+
97+
Python is available globally at `/python/bin/python`. Each agent should create its own virtual environment:
98+
99+
```bash
100+
python -m venv /app/venv
101+
source /app/venv/bin/activate
102+
```
103+
104+
## Node.js Environment
105+
106+
Node.js, npm, and npx are available globally:
107+
108+
```bash
109+
node --version # v22.x.x
110+
npm --version
111+
```
112+
113+
## License
114+
115+
Maintained by Bindu team.
116+
117+
## Contact
118+
119+
**Author**: Raahul Dutta <raahul@getbindu.com>

0 commit comments

Comments
 (0)