Skip to content

jbadeau/gib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Docker OCI

Gib

Build containers. Skip the daemon.

Quick Start  |  Features  |  CLI Reference  |  Go Library


What is Gib?

Gib is a lightweight, daemonless container image builder and a drop-in replacement for Jib CLI. One static binary, no JVM. Your existing jib.yaml files just work.

Features

  • Drop-in Jib replacement — 100% compatible with jib.yaml build files
  • No runtime dependencies — builds container images directly, no daemon or JVM needed
  • Go library — use programmatically in your Go applications
  • Powered by go-containerregistry — battle-tested container image library
  • Modern CLI — powered by Fang

Quick Start

Install

With mise-gib (recommended):

mise plugin install gib https://github.com/jbadeau/mise-gib.git
mise install gib@latest
mise use gib@latest

With go install:

go install github.com/jbadeau/gib/cmd/gib@latest

Build an image

gib build --target=my-registry.example.com/my-app:latest

Build to a tar file

gib build --target=tar://my-image.tar

Minimal jib.yaml

apiVersion: jib/v1alpha1
kind: BuildFile

from:
  image: ubuntu

entrypoint: ["/app/run.sh"]

layers:
  entries:
    - name: app
      files:
        - src: .
          dest: /app

CLI Reference

gib build --target <image> [options]
Option Description
-t, --target (required) Target image reference or tar://<path>
-b, --build-file Build file path (default: jib.yaml)
-c, --context Build context directory (default: .)
-p, --parameter Template parameter key=value (repeatable)
--from Override base image
--image-format Docker or OCI (default: Docker)
--additional-tags Extra tags for registry targets
--credential-helper Docker credential helper suffix
--username / --password Registry credentials

Run gib build --help for the full list of options.

Go Library

Use Gib programmatically to build container images in your Go applications:

builder := gib.From("ubuntu:22.04").
    SetEntrypoint("sh", "run.sh").
    SetUser("appuser").
    SetWorkingDirectory("/app")

result, err := builder.Containerize(
    context.Background(),
    gib.ToRegistry("my-registry.example.com/app:v1"),
)

Or build from an existing jib.yaml:

spec, _ := buildfile.Parse("jib.yaml", nil)
builder, _ := buildfile.Convert(spec, ".", nil)
result, _ := builder.Containerize(ctx, gib.ToTar("image.tar"))

License

Apache 2.0

About

Build containers. Skip the daemon.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages