Images
Overview
The Images app provides a central location for viewing properties of container image assets used in deployments. For more information about the images App and how to use it in Apolo Console, visit the main Images app page.
Command Line Interface
While the Images app provides a graphical interface for viewing image properties, the Apolo CLI offers powerful commands for managing container images directly from your terminal. The apolo image
command suite includes the following operations:
Basic Commands
apolo image ls
: Lists images in your current project and cluster. Supports filtering by name, organization, and project.apolo image tags
: Lists all tags associated with an image.apolo image rm
: Removes images from the platform registry.apolo image size
: Shows the size of a specific image.apolo image digest
: Retrieves the digest of an image from the remote registry.
Working with Images
The most commonly used operations are pushing and pulling images. Here's how to use them effectively:
Pushing images to the registry:
Pulling images from the registry:
Image Naming Convention
When working with the CLI, image names follow a specific URL scheme:
Remote images must use the
image://
schemeTags can be specified using the colon notation (e.g.,
image:myapp:v1.0
)Cross-project references use the format
image:/other-project/imagename:tag
Note: All commands provide additional help information through the --help
option, which details available flags and usage examples.
Using External Images
While the Images app and CLI provide tools for managing images in the platform registry, you can also run jobs using external Docker images. Simply specify the full image path when using apolo job run
:
This flexibility allows you to leverage both platform-hosted images and publicly available container images from Docker Hub or other registries, depending on your needs. The same job configuration options apply regardless of whether you're using internal or external images.
Working with Images in Workflows
Apolo Workflows provide a powerful way to automate image building and management as part of your development process. While you can build images directly using the CLI, workflows offer more sophisticated features for image handling, especially when working with complex build requirements or multiple image variants.
Defining Images in Live Workflows
In your .apolo/live.yml
file, you can define images under the images
section. Each image definition can specify its build context, Dockerfile location, build arguments, and resulting reference. Here's an example:
This workflow defines two images with different configurations. The training_image
uses content-based tagging through the hash_files
function, which automatically generates a new tag when the source files change. The inference_image
uses a GPU-enabled preset for its build process.
Using Workflow Images in Jobs
Once defined, these images can be referenced in your workflow jobs:
Building Images with Workflows
To build images defined in your workflow, use the apolo-flow build
command:
The workflow system handles the entire build process, including:
Setting up the build environment according to your specifications
Managing build arguments and environment variables
Uploading the build context to the platform
Building the image using Kaniko in the cloud
Publishing the resulting image to the platform registry
Advanced Build Features
Workflows provide several advanced features for image building:
Content-based tagging using
hash_files()
for automatic version managementBuild-time secret management through environment variables and mounted volumes
Resource preset selection for builds requiring specific hardware
Build argument and environment variable interpolation using workflow expressions
This integration of image building into workflows allows you to create reproducible, automated processes for managing your container images as part of your larger application lifecycle.
For detailed information about workflow syntax and capabilities, refer to our workflow documentation. All image-related operations in workflows follow the same naming conventions described in the CLI section above.
Building Custom Images without Workflows
The Apolo Extras CLI provides powerful tools for building and managing custom container images. This functionality is available through the apolo-extras image
command suite, which offers two main approaches to building images:
Remote Building:
Local Building:
The remote build option uses Kaniko to construct images directly on the cluster, which is particularly useful when you don't have Docker installed locally or need to access cluster-specific resources during the build process. The local build option leverages your local Docker daemon, providing a familiar development experience.
Additionally, you can transfer images between clusters using:
For detailed information about image building options, including advanced Kaniko configurations and build customization, please refer to the Apolo Extras CLI documentation.
Last updated