diff --git a/openfl/interface/workspace.py b/openfl/interface/workspace.py index 260c71eed1..5d335ccbec 100644 --- a/openfl/interface/workspace.py +++ b/openfl/interface/workspace.py @@ -402,8 +402,34 @@ def export_() -> str: ) @pass_context def dockerize_(context, save, rebuild, revision): - """Package current workspace as a Docker image.""" + """ + Package the current workspace as a Docker image. + + This function performs the following steps: + 1. Exports the current workspace. + 2. Builds the OpenFL base Docker image. + 3. Builds the workspace Docker image based on the exported workspace. + 4. Optionally saves the workspace Docker image as a tarball file. + + Parameters: + context: The context object that provides access to shared information and methods,such as invoking other commands or accessing configuration settings. + save (bool): If True, saves the workspace Docker image as a tarball (`.tar`) file. + rebuild (bool): If True, forces a rebuild of the Docker images without using the cache. + revision (str): Specifies the OpenFL revision to use as a build argument in the Docker build process. + + Returns: + None + Raises: + RuntimeError: If any of the Docker commands fail during execution. + + Example: + To package the workspace and save the Docker image as a tarball: + + ```python + dockerize_(context, save=True, rebuild=False, revision='main') + ``` + """ # Docker build options options = [] options.append("--no-cache" if rebuild else "")