OCI Containerfile specifications
Containerfile is a configuration file that automates the steps of creating an OCI artifact. It is similar to a Dockerfile. Container engines such as Podman read instructions from the
Containerfile to automate the
steps that are otherwise performed manually to create an OCI artifact.
Containerfile describes the steps that are taken to assemble the OCI artifact. When the
Containerfile is created, call the Podman build command by using the path of context directory that contains
Containerfile as the argument. Podman defaults to
Containerfile and will fall back to Dockerfile.
To build an OCI artifact, create a file called
Containerfile. The syntax for
Containerfile is similar to that of Dockerfile.
The instruction is not case-sensitive. However, convention is for them to be uppercase to distinguish them from arguments more easily.
|Syntax and Description
The Containerfile must start with the statement
COPY <source> <destination>
Copy files, directories into the OCI artifact.
The "LABEL" instruction adds metadata to an OCI artifact. A LABEL is a key-value pair. To specify a LABEL without a value, simply use an empty string. To include spaces within a LABEL value, use quotation marks and backslashes as you would in command-line parsing.
An OCI artifact can have more than one label. To specify multiple labels, separate each key-value pair by a space.
Insert any comments by using
Visit GitHub repo for
Containerfile format example.