|
| 1 | +```mermaid |
| 2 | +graph LR |
| 3 | + Build_System["Build System"] |
| 4 | + Build_Context_Preparation["Build Context Preparation"] |
| 5 | + Authentication_Management["Authentication Management"] |
| 6 | + API_Versioning_and_Decorators["API Versioning and Decorators"] |
| 7 | + Stream_Processing["Stream Processing"] |
| 8 | + Error_Handling["Error Handling"] |
| 9 | + Build_System -- "Orchestrates" --> Build_Context_Preparation |
| 10 | + Build_System -- "Utilizes" --> Authentication_Management |
| 11 | + Build_System -- "Processes Output Via" --> Stream_Processing |
| 12 | + Build_System -- "Raises" --> Error_Handling |
| 13 | + Build_System -- "Enforces Compatibility Via" --> API_Versioning_and_Decorators |
| 14 | + Build_Context_Preparation -- "Uses" --> Fnmatch_Utilities |
| 15 | +``` |
| 16 | +[](https://github.com/CodeBoarding/GeneratedOnBoardings)[](https://www.codeboarding.org/demo)[](mailto:[email protected]) |
| 17 | + |
| 18 | +## Component Details |
| 19 | + |
| 20 | +This graph illustrates the core components and their interactions within the `docker-py` library's build system. The primary flow revolves around the `Build System` component, which orchestrates the entire image building process. It relies on `Build Context Preparation` to create the necessary build context, `Authentication Management` for handling registry credentials, and `Stream Processing` to interpret the real-time output from the Docker daemon. `API Versioning and Decorators` ensure compatibility with different Docker API versions, while `Error Handling` provides structured error reporting for various build-related issues. |
| 21 | + |
| 22 | +### Build System |
| 23 | +Manages the end-to-end process of building Docker images, including orchestrating context preparation, applying authentication, and processing build output streams. It serves as the primary interface for image creation within the `docker-py` library. |
| 24 | + |
| 25 | + |
| 26 | +**Related Classes/Methods**: |
| 27 | + |
| 28 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/api/build.py#L11-L352" target="_blank" rel="noopener noreferrer">`docker-py.docker.api.build.BuildApiMixin` (11:352)</a> |
| 29 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/api/build.py#L12-L275" target="_blank" rel="noopener noreferrer">`docker-py.docker.api.build.BuildApiMixin:build` (12:275)</a> |
| 30 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/api/build.py#L321-L352" target="_blank" rel="noopener noreferrer">`docker-py.docker.api.build.BuildApiMixin:_set_auth_headers` (321:352)</a> |
| 31 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/api/build.py#L355-L382" target="_blank" rel="noopener noreferrer">`docker-py.docker.api.build.process_dockerfile` (355:382)</a> |
| 32 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/models/images.py#L220-L315" target="_blank" rel="noopener noreferrer">`docker-py.docker.models.images.ImageCollection:build` (220:315)</a> |
| 33 | + |
| 34 | + |
| 35 | +### Build Context Preparation |
| 36 | +Responsible for preparing the local build context for Docker image creation. This includes archiving the necessary files and directories, applying exclusion rules from `.dockerignore`, and ensuring the context is ready for transmission to the Docker daemon. |
| 37 | + |
| 38 | + |
| 39 | +**Related Classes/Methods**: |
| 40 | + |
| 41 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/utils/build.py#L70-L120" target="_blank" rel="noopener noreferrer">`docker-py.docker.utils.build:create_archive` (70:120)</a> |
| 42 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/utils/build.py#L41-L55" target="_blank" rel="noopener noreferrer">`docker-py.docker.utils.build:exclude_paths` (41:55)</a> |
| 43 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/utils/build.py#L22-L38" target="_blank" rel="noopener noreferrer">`docker-py.docker.utils.build:tar` (22:38)</a> |
| 44 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/utils/build.py#L159-L219" target="_blank" rel="noopener noreferrer">`docker-py.docker.utils.build.PatternMatcher` (159:219)</a> |
| 45 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/utils/build.py#L166-L183" target="_blank" rel="noopener noreferrer">`docker-py.docker.utils.build.PatternMatcher:matches` (166:183)</a> |
| 46 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/utils/build.py#L58-L67" target="_blank" rel="noopener noreferrer">`docker-py.docker.utils.build.build_file_list` (58:67)</a> |
| 47 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/utils/build.py#L123-L139" target="_blank" rel="noopener noreferrer">`docker-py.docker.utils.build.mkbuildcontext` (123:139)</a> |
| 48 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/utils/fnmatch.py#L26-L44" target="_blank" rel="noopener noreferrer">`docker-py.docker.utils.fnmatch:fnmatch` (26:44)</a> |
| 49 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/utils/fnmatch.py#L47-L60" target="_blank" rel="noopener noreferrer">`docker-py.docker.utils.fnmatch:fnmatchcase` (47:60)</a> |
| 50 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/utils/fnmatch.py#L63-L115" target="_blank" rel="noopener noreferrer">`docker-py.docker.utils.fnmatch:translate` (63:115)</a> |
| 51 | + |
| 52 | + |
| 53 | +### Authentication Management |
| 54 | +Handles the loading, parsing, and resolution of Docker authentication configurations. It provides mechanisms to retrieve credentials from various sources and format them for inclusion in API requests, particularly for pulling base images during a build. |
| 55 | + |
| 56 | + |
| 57 | +**Related Classes/Methods**: |
| 58 | + |
| 59 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/auth.py#L348-L349" target="_blank" rel="noopener noreferrer">`docker-py.docker.auth:load_config` (348:349)</a> |
| 60 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/auth.py#L75-L306" target="_blank" rel="noopener noreferrer">`docker-py.docker.auth.AuthConfig` (75:306)</a> |
| 61 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/auth.py#L144-L189" target="_blank" rel="noopener noreferrer">`docker-py.docker.auth.AuthConfig.load_config` (144:189)</a> |
| 62 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/auth.py#L285-L303" target="_blank" rel="noopener noreferrer">`docker-py.docker.auth.AuthConfig.get_all_credentials` (285:303)</a> |
| 63 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/auth.py#L272-L277" target="_blank" rel="noopener noreferrer">`docker-py.docker.auth.AuthConfig._get_store_instance` (272:277)</a> |
| 64 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/auth.py#L244-L270" target="_blank" rel="noopener noreferrer">`docker-py.docker.auth.AuthConfig._resolve_authconfig_credstore` (244:270)</a> |
| 65 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/auth.py#L315-L316" target="_blank" rel="noopener noreferrer">`docker-py.docker.auth.convert_to_hostname` (315:316)</a> |
| 66 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/auth.py#L327-L329" target="_blank" rel="noopener noreferrer">`docker-py.docker.auth.encode_header` (327:329)</a> |
| 67 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/auth.py#L309-L312" target="_blank" rel="noopener noreferrer">`docker-py.docker.auth.resolve_authconfig` (309:312)</a> |
| 68 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/auth.py#L319-L324" target="_blank" rel="noopener noreferrer">`docker-py.docker.auth.decode_auth` (319:324)</a> |
| 69 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/auth.py#L332-L345" target="_blank" rel="noopener noreferrer">`docker-py.docker.auth.parse_auth` (332:345)</a> |
| 70 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/auth.py#L352-L378" target="_blank" rel="noopener noreferrer">`docker-py.docker.auth._load_legacy_config` (352:378)</a> |
| 71 | + |
| 72 | + |
| 73 | +### API Versioning and Decorators |
| 74 | +Provides utilities for comparing Docker API versions and implements decorators to enforce minimum API versions for client methods. This ensures that API calls are compatible with the connected Docker daemon and handles version-specific behaviors. |
| 75 | + |
| 76 | + |
| 77 | +**Related Classes/Methods**: |
| 78 | + |
| 79 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/utils/utils.py#L77-L78" target="_blank" rel="noopener noreferrer">`docker-py.docker.utils.utils:version_lt` (77:78)</a> |
| 80 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/utils/utils.py#L81-L82" target="_blank" rel="noopener noreferrer">`docker-py.docker.utils.utils:version_gte` (81:82)</a> |
| 81 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/utils/utils.py#L49-L74" target="_blank" rel="noopener noreferrer">`docker-py.docker.utils.utils:compare_version` (49:74)</a> |
| 82 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/utils/decorators.py#L24-L34" target="_blank" rel="noopener noreferrer">`docker-py.docker.utils.decorators:minimum_version` (24:34)</a> |
| 83 | + |
| 84 | + |
| 85 | +### Stream Processing |
| 86 | +Manages the parsing and handling of streaming data, particularly JSON streams, received from the Docker daemon. This component is crucial for processing real-time output during long-running operations like image builds, enabling progress reporting and error detection. |
| 87 | + |
| 88 | + |
| 89 | +**Related Classes/Methods**: |
| 90 | + |
| 91 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/utils/json_stream.py#L35-L40" target="_blank" rel="noopener noreferrer">`docker-py.docker.utils.json_stream:json_stream` (35:40)</a> |
| 92 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/utils/json_stream.py#L50-L74" target="_blank" rel="noopener noreferrer">`docker-py.docker.utils.json_stream:split_buffer` (50:74)</a> |
| 93 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/utils/json_stream.py#L9-L19" target="_blank" rel="noopener noreferrer">`docker-py.docker.utils.json_stream.stream_as_text` (9:19)</a> |
| 94 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/utils/json_stream.py#L43-L47" target="_blank" rel="noopener noreferrer">`docker-py.docker.utils.json_stream.line_splitter` (43:47)</a> |
| 95 | + |
| 96 | + |
| 97 | +### Error Handling |
| 98 | +Defines a hierarchy of custom exception classes used throughout the `docker-py` library. These exceptions represent specific error conditions encountered during interactions with the Docker daemon or due to invalid client-side operations, providing structured error reporting. |
| 99 | + |
| 100 | + |
| 101 | +**Related Classes/Methods**: |
| 102 | + |
| 103 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/errors.py#L100-L101" target="_blank" rel="noopener noreferrer">`docker-py.docker.errors.InvalidVersion` (100:101)</a> |
| 104 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/errors.py#L13-L19" target="_blank" rel="noopener noreferrer">`docker-py.docker.errors.DockerException` (13:19)</a> |
| 105 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/errors.py#L153-L155" target="_blank" rel="noopener noreferrer">`docker-py.docker.errors.StreamParseError` (153:155)</a> |
| 106 | +- <a href="https://github.com/docker/docker-py/blob/master/docker/errors.py#L158-L162" target="_blank" rel="noopener noreferrer">`docker-py.docker.errors.BuildError` (158:162)</a> |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) |
0 commit comments