Create base OCI image with Nix

t-320.2·WorkTask·
·
·
·Omni/Agentd/Images.hs
Parent:t-320·Created1 month ago·Updated1 month ago

Dependencies

Description

Edit

Summary

Create a minimal OCI image containing agent + busybox using Nix.

Contents

  • agent binary (static, from t-319)
  • busybox (provides sh, ls, cat, grep, find, etc.)
  • Minimal filesystem structure

Filesystem Layout

/
├── bin/
│   ├── agent
│   └── busybox (+ symlinks: sh, ls, cat, grep, etc.)
├── etc/
│   └── ssl/certs/  (for HTTPS)
├── tmp/
├── var/lib/
│   ├── skills/     (mount point)
│   └── roles/      (mount point)
└── workspace/      (mount point)

Implementation

# Omni/Agentd/Images/Base.nix
{ pkgs, agent }:

pkgs.dockerTools.buildLayeredImage {
  name = "agent-base";
  tag = "latest";
  
  contents = [
    pkgs.busybox
    agent  # from t-319
    pkgs.cacert
  ];
  
  config = {
    Cmd = [ "/bin/agent" ];
    WorkingDir = "/workspace";
    Env = [
      "PATH=/bin"
      "SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt"
    ];
  };
}

Build

nix build .#agent-base
# Outputs: result/agent-base.tar.gz

# Load into podman
podman load < result/agent-base.tar.gz

Deliverables

  • [ ] Omni/Agentd/Images/Base.nix
  • [ ] Integration with repo's flake.nix
  • [ ] Image builds successfully
  • [ ] podman run agent-base agent --help works

Timeline (2)

🔄[human]Open → InProgress1 month ago
🔄[human]InProgress → Done1 month ago