Overview
ThePackageOptions class defines configuration for how your application is built and packaged into a container image.
Constructor
Parameters
The container registry repository where the image will be stored.Example:
'myusername', 'gcr.io/myproject'The name of the container image. If not provided, defaults to the basename of the current working directory.Example:
'myapp', 'web-service'The builder to use for creating the container image.Options:
'docker'Whether to push the built image to the container registry.Set to
True to automatically publish after building.Enable verbose output during the build process.Set to
False to reduce output verbosity.Suppress output during the build process.Set to
True for minimal output.The Python version to use in the generated Dockerfile.Example:
3 (for Python 3.x Alpine base image)Usage
Basic Configuration
Full Configuration
With Custom Dockerfile
Default Dockerfile
When no custom Dockerfile is provided, Buildr generates a default Dockerfile:Required vs Optional
Required Parameters:repository- Must be provided
- All other parameters have sensible defaults
Image Naming
The final image name is constructed as:repository='myrepo',name='myapp'→myrepo/myapp:latestrepository='gcr.io/project',name='service'→gcr.io/project/service:latest