Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Docker Image generator:
docker-image

Mount nameTypeUsage
inputLayersThe Raptor build target to genrate as a docker image.
outputFilePoints to the resulting docker image file.
cache
(Optional)
SimpleCache for tar files of built layers.
Will save time when repeating layers between builds.

This builder generates a Docker image from a Raptor target.

Each layer in Raptor (one for the target, plus one for each FROM) becomes a Docker layer in the generated image. This allows shared Raptor layers to stay shared when converted to Docker images.

Compatibility

TargetCompatible?
Container: systemd-nspawn
Container: docker
Container: podman
Virtual Machine (UEFI)
Virtual Machine (BIOS)
Physical Machine (UEFI)
Physical Machine (BIOS)

Example

Prerequisites:

  • raptor-builders is cloned to raptor-builders
  • An input target called test.rapt

Raptor.toml

[raptor.link]
rbuild = "raptor-builders"

# Docker image
[run.docker1]
target = "$rbuild.docker-image" # <-- builder is specified here
input = ["test"]
output = "test.tar"
## to speed up builds with shared layers,
## specify a cache directory:
# cache = "/tmp/docker-image-cache"

After this Raptor.toml is in place, call raptor make to build:

sudo raptor make docker1

When the process is complete, test.tar will be ready for use.

It can be imported:

# import to Docker
docker load -i test.tar

# import to Podman
podman load -i test.tar