Dockerfile instructions
Dockerfile ONBUILD
Registers a deferred instruction to execute during downstream FROM processing. The child supplies required context inputs. Executed inherited triggers are cleared. Review base triggers before use. Inspect the recorded trigger before the child build; stop if the approved local base cannot resolve offline.
Formal Syntax & Structure
docker syntaxdocker
ONBUILD <instruction>Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| instruction | string | Supported deferred build instruction. |
Working Example
Example Snippetdocker
FROM busybox:1.37ONBUILD COPY downstream.txt /downstream.txtCMD ["echo", "base only"]