Sign inSign up

gaetanddr/baseimage-alpine

By gaetanddr

â€ĒUpdated 10 months ago

Base images built from Alpine

Image
0

1.2K

gaetanddr/baseimage-alpine repository overview

⁠BoxHarbor Base Image - Alpine

Docker Pulls GitHub

A lightweight, rootless-compatible base image built on Alpine Linux with tini process manager. Designed for building containerized applications that work seamlessly with both Docker and Podman in rootless mode.

⁠Features

  • ðŸŠķ Lightweight: Based on Alpine Linux
  • 🔒 Rootless Compatible: Works with Podman and Docker rootless mode
  • ðŸŽŊ Simple Init System: Uses tini for proper signal handling
  • 📁 Standardized Structure: /config for persistent data
  • 🔧 Customizable: Easy-to-extend with init and service scripts
  • 🌍 Multi-arch: Supports amd64, arm64, armv7

⁠Quick Start

This is a base image meant to be used as a foundation for other images.

FROM ghcr.io/boxharbor/baseimage-alpine:latest

# Install your application
RUN apk add --no-cache your-package

# Add your service script
COPY rootfs/ /

# Expose ports
EXPOSE 8080

⁠Environment Variables

VariableDefaultDescription
PUID1000User ID for file permissions
PGID1000Group ID for file permissions
TZUTCTimezone
UMASK022File creation mask

⁠Directory Structure

/app        - Application files
/config     - Persistent configuration (mount this!)
/defaults   - Default configuration templates

⁠Extending the Base Image

⁠Adding Init Scripts

Create scripts in /etc/cont-init.d/ that run during container startup:

#!/bin/bash
# /etc/cont-init.d/20-my-init

echo "Running custom initialization..."
# Your setup logic here

Scripts are executed in alphanumeric order (10-, 20-, 30-, etc.).

⁠Adding Services

Create service directories in /etc/services.d/:

#!/bin/bash
# /etc/services.d/myapp/run

cd /app
exec /app/myapp-binary

Services run as background processes managed by the init system.

⁠Usage Examples

⁠With Docker
docker run -d \
  --name myapp \
  -v ./config:/config \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  your-app:latest
⁠With Podman (Rootless)
podman run -d \
  --name myapp \
  -v ./config:/config:Z \
  -e PUID=1000 \
  -e PGID=1000 \
  your-app:latest

Note: Use :Z suffix for SELinux systems (Fedora, RHEL, CentOS).

⁠Building from Source

git clone https://github.com/BoxHarbor/baseimage-alpine.git
cd baseimage-alpine
docker build -t boxharbor/baseimage-alpine:latest .

⁠Contributing

Contributions are welcome! Please read our Contributing Guidelines⁠ before submitting PRs.

⁠License

GPL-3.0 License - see LICENSE⁠ file for details.

⁠Support


Built with âĪïļ by the BoxHarbor team

Tag summary

Content type

Image

Digest

sha256:483f5c405â€Ķ

Size

8.5 MB

Last updated

10 months ago

docker pull gaetanddr/baseimage-alpine