Building an image with z/OS Provisioning Toolkit
After templates are set up in z/OSMF, you use the zospt build command to build an image. This image is a set of files and configuration information that is used with an associated z/OSMF template to provision one or more containers with the same capability. You need to set up the zosptfile, then run the zospt build command to build the image.
About this task
A z/OS PT image is created by using the zospt build command. You can create images from scratch, or base an image on an existing one. In this way, you can create stacks of images that together build different containers. For a reminder of how images work with z/OS PT, see What is z/OS Provisioning Toolkit?.
The build command takes the contents of a zosptfile and uses that to determine what is put into an image. A zosptfile is a text document in UTF-8 encoding that defines the instruction set that is used to assemble an image. Valid instructions are shown in the following table:
Instruction | Description |
---|---|
FROM imageName | Defines the image on which this image is based. If you specify FROM scratch ,
this image is the base image. It is not based on another image. scratch is a
reserved base image that is the starting point for building environments. scratch
cannot be directly built or run.Note: If you create an image by building on an existing image, the
environment variables in the original image persist.
|
ENV ZOSMF_TEMPLATE=template name | Associate this image with a z/OSMF template. |
ENV key=value |
Define an environment variable for this image. Some templates, such as CICS®, allow environment variables to be specified to further customize the configuration of a provisioned environment. You can customize some of the properties of a provisioned environment by adding environment variable definitions to the zosptfile for the image, which can override values that are specified in the properties file of the template that is named in the image. For more information about which properties can be added to the zosptfile for an image, see the Configuration properties file for the product you are provisioning. Environment variables that are defined in a zosptfile for
image_1 can also be referenced by other instructions in the same
zosptfile, or by zosptfile instructions of other images
built The sample images that are provided with z/OS PT give examples of environment variables. For more information about sample images, see Samples provided with z/OS Provisioning Toolkit. |
COPY fromFile toFile | Copy a file or directory into this image. The file must be in the same directory as the zosptfile, or one of its subdirectories. |
For examples of zosptfile text files, see Samples provided with z/OS Provisioning Toolkit.