OCI Containerfile specifications

The 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.

The 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.

Format

INSTRUCTION arguments

The instruction is not case-sensitive. However, convention is for them to be uppercase to distinguish them from arguments more easily.

Supported Instructions

Instruction Syntax and Description
From FROM scratch

The Containerfile must start with the statement FROM scratch.
COPY COPY <source> <destination>

Copy files, directories into the OCI artifact.
Examples
  1. Copy the Git z/OS Product pax file.
    COPY git-2.41.0.20230721_160408.zos.pax.Z 
    git-2.41.0.20230721_160408.zos.pax.Z
  2. Include the zpm directory that contains a preinstall, install script, and uninstall scripts may be added in future if needed.
    COPY zpm .zpm
  3. Include install_test script.
    COPY install_test.sh install_test.sh
LABEL LABEL <key><value>

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.
LABEL name=git

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 # Comments.

Visit GitHub repo for Containerfile format example.