Skip to main content
Host UK

Borgfile Compilation (RFC-0021)

Lethean R&D Labs
RFC Build Containers Dockerfile

Borgfile is a declarative syntax for defining TIM container contents. Dockerfile-like familiarity for reproducible container builds. Simple ADD directives map local files into the container filesystem.

Features

Dockerfile-Like

Familiar syntax for anyone who's written a Dockerfile

ADD Directive

Map local files/directories into container paths

Reproducible

Same Borgfile → same container every time

Encryption Ready

Output directly to encrypted STIM format

Installation

# Compile Borgfile to TIM
borg compile -f Borgfile -o app.tim

# Compile to encrypted STIM
borg compile -f Borgfile -e "password" -o app.stim

Usage

Borgfile Syntax

# Comments start with #

# Add single file
ADD ./config.json /etc/app/config.json

# Add directory
ADD ./bin/ /usr/local/bin/

# Add with rename
ADD ./myapp /app/server

Parsing

lines := strings.Split(content, "\n")
for _, line := range lines {
    parts := strings.Fields(line)
    switch parts[0] {
    case "ADD":
        // parts[1] = source, parts[2] = destination
    }
}

More from Lethean R&D Labs

View all projects →

Fancy helping out?

Spotted a bug? Got an idea? We'd love to hear from you.

Read the contributing guide →