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

Instruction: FROM

Summary

FROM [<schema>://]<from-source>

The FROM instruction bases the current layer on top of some the specified layer.

This instruction is not required. If no FROM instruction is used, the target is building from an empty base, with no dependencies.

Multiple FROM instructions are not supported.

From sources

Raptor supports multiple options for from-source:

TypeSchemaExample
Raptor<none>FROM library.base
Dockerdocker://FROM docker://debian:trixie

Raptor sources

When no schema is specified, the from-source is assumed to be the module name of another raptor layer.

Tip

This will be familiar to docker users. For example..

# Dockerfile
FROM base

..will depend on the docker image base

However, unlike docker files, raptor can point to raptor files in other directories, or even other packages. See module names for an overview.

Examples

# This will depend on `base.rapt`
FROM base
# This will depend on `library/debian.rapt`
FROM library.debian

Docker sources

To use a docker image as the basis for a raptor layer, specify the name of the docker image, prefixed with docker://, e.g:

FROM docker://debian:trixie

Tip

In general, docker pull <NAME> becomes FROM docker://<NAME>

There are multiple (optional) parts in a docker reference, which has a surprisingly intricate syntax.

Raptor supports the entire grammar for docker references, so anything that docker pull will accept, should work with FROM docker:// in raptor.