Image Management¶
Build and push the flaude Docker image to Fly.io's container registry.
ensure_image
async
¶
ensure_image(app_name, *, tag=DEFAULT_TAG, token=None, docker_context=None, build_timeout=600, push_timeout=600)
Build, authenticate, and push the flaude Docker image in one call.
This is the high-level convenience function that orchestrates the full image lifecycle: build → login → push.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_name
|
str
|
The Fly.io app name. |
required |
tag
|
str
|
Image tag. Defaults to |
DEFAULT_TAG
|
token
|
str | None
|
Explicit Fly API token for registry auth. |
None
|
docker_context
|
Path | None
|
Override the Docker build context directory. |
None
|
build_timeout
|
float
|
Max seconds for the build step. |
600
|
push_timeout
|
float
|
Max seconds for the push step. |
600
|
Returns:
| Type | Description |
|---|---|
str
|
The full image reference (e.g. |
Raises:
| Type | Description |
|---|---|
ImageBuildError
|
If any step in the pipeline fails. |
Source code in flaude/image.py
docker_build
async
¶
docker_build(app_name, *, tag=DEFAULT_TAG, platform='linux/amd64', docker_context=None, timeout=600)
Build the flaude Docker image and tag it for Fly's registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_name
|
str
|
The Fly.io app name (used in the image tag). |
required |
tag
|
str
|
Image tag. Defaults to |
DEFAULT_TAG
|
platform
|
str
|
Target platform for the image. Defaults to |
'linux/amd64'
|
docker_context
|
Path | None
|
Path to the directory containing the Dockerfile.
Defaults to the |
None
|
timeout
|
float
|
Max seconds to wait for the build. Defaults to 600 (10 min). |
600
|
Returns:
| Type | Description |
|---|---|
str
|
The full image reference (e.g. |
Raises:
| Type | Description |
|---|---|
ImageBuildError
|
If the docker build command fails. |
Source code in flaude/image.py
docker_push
async
¶
Push the flaude Docker image to Fly.io's container registry.
The image must already be built (via :func:docker_build).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_name
|
str
|
The Fly.io app name. |
required |
tag
|
str
|
Image tag. Defaults to |
DEFAULT_TAG
|
timeout
|
float
|
Max seconds to wait for the push. Defaults to 600 (10 min). |
600
|
Returns:
| Type | Description |
|---|---|
str
|
The full image reference that was pushed. |
Raises:
| Type | Description |
|---|---|
ImageBuildError
|
If the docker push command fails. |
Source code in flaude/image.py
docker_login_fly
async
¶
Authenticate Docker to Fly.io's container registry.
Uses flyctl auth docker which configures Docker credentials for
registry.fly.io. Requires FLY_API_TOKEN to be set or passed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token
|
str | None
|
Explicit Fly API token. If not provided, uses FLY_API_TOKEN from the environment. |
None
|
Raises:
| Type | Description |
|---|---|
ImageBuildError
|
If authentication fails. |
Source code in flaude/image.py
ImageBuildError
¶
Bases: Exception
Raised when the Docker image build or push fails.
Attributes:
| Name | Type | Description |
|---|---|---|
returncode |
The process exit code from the failed command, or |
|
stderr |
Captured stderr output from the failed command (may be empty). |