Docker¶
docker
¶
Functions:
| Name | Description |
|---|---|
check_image |
Check an Odoo Docker image for registry and age issues. |
fetch_odoo_images |
Fetch available Odoo Docker images filtered by collection. |
find_available_images |
Find Odoo images newer than a given release date that match version and edition. |
format_available_images |
Render a list of available Odoo images as a formatted table string. |
parse_image_tag |
Parse an Odoo Docker image tag into its structured components. |
warn_deprecated_registry |
Issue a DeprecatedRegistryWarning for a known deprecated Docker registry. |
warn_unusual_registry |
Issue an UnusualRegistryWarning for an unrecognised Docker registry. |
check_image
¶
Check an Odoo Docker image for registry and age issues.
In strict mode, issues are raised as warnings. Otherwise they are collected and returned as strings for the caller to handle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ImageInfo
|
ImageInfo to validate. |
required |
|
bool
|
If True, emit Python warnings directly. Defaults to True. |
True
|
Returns:
| Type | Description |
|---|---|
list
|
List of warning message strings (empty when strict is True or no issues found). |
Source code in oops/services/docker.py
fetch_odoo_images
¶
fetch_odoo_images(collections: Optional[list] = None) -> list
Fetch available Odoo Docker images filtered by collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Optional[list]
|
List of collection names to include. Defaults to config.images.collections. |
None
|
Returns:
| Type | Description |
|---|---|
list
|
List of ImageInfo objects matching the requested collections. |
Source code in oops/services/docker.py
find_available_images
¶
Find Odoo images newer than a given release date that match version and edition.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
date
|
Reference release date; only images with a newer release are returned. |
required |
|
bool
|
If True, filter for enterprise images; otherwise community. |
required |
|
float
|
Odoo major version to filter on (e.g. 18.0). |
required |
Returns:
| Type | Description |
|---|---|
list
|
List of matching ImageInfo objects sorted by release date descending, |
list
|
each annotated with a delta attribute (days from release). |
Source code in oops/services/docker.py
format_available_images
¶
format_available_images(images: list, include_index: bool = False) -> str
Render a list of available Odoo images as a formatted table string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list
|
List of ImageInfo objects to display (as returned by find_available_images). |
required |
|
bool
|
If True, prepend a numeric index column. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
str
|
Formatted table string, or an empty string if images is empty. |
Source code in oops/services/docker.py
parse_image_tag
¶
Parse an Odoo Docker image tag into its structured components.
Expected pattern: <registry>/<repository>:<major>[.0][-<YYYYMMDD>][-enterprise][-legacy]
Examples: odoo:19, apik/odoo:19.0-20250919-enterprise
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
Full Docker image tag string to parse. |
required |
Returns:
| Type | Description |
|---|---|
ImageInfo
|
ImageInfo populated with registry, repository, version, release date, and flags. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the tag is missing a colon separator or has an unrecognised version format. |
Source code in oops/services/docker.py
warn_deprecated_registry
¶
Issue a DeprecatedRegistryWarning for a known deprecated Docker registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
Name of the deprecated registry. |
required |
Source code in oops/services/docker.py
warn_unusual_registry
¶
Issue an UnusualRegistryWarning for an unrecognised Docker registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
Name of the unusual registry. |
required |