docker_pkg.drivers¶
Functions
|
Factory method to get the driver. |
|
Changes the current directory of execution. |
Classes
|
Lower-level management of docker images |
|
Method generated by attrs for class DriverInterface. |
- class docker_pkg.drivers.DriverInterface(config: Dict[str, Any], label: ImageLabel)[source]¶
Bases:
object
Method generated by attrs for class DriverInterface.
- config: Dict[str, Any]¶
- label: ImageLabel¶
- property buildargs: Dict[str, str]¶
- do_build(build_path: str, filename: str = 'Dockerfile') str [source]¶
Given a build context and a dockerfile, build an image and return its label
- add_tag(lbl: ImageLabel, tag: str)[source]¶
Add a new tag to a docker image
- class docker_pkg.drivers.DockerDriver(config: Dict[str, Any], label: ImageLabel, client: DockerClient, nocache: bool = True)[source]¶
Bases:
DriverInterface
Lower-level management of docker images
Method generated by attrs for class DockerDriver.
- config: Dict[str, Any]¶
- label: ImageLabel¶
- client: DockerClient¶
- nocache: bool¶
- do_build(build_path: str, filename: str = 'Dockerfile') str [source]¶
Builds the image
Parameters: build_path - context where the build must be performed filename - the file to output the generated dockerfile to
Returns the image label Raises an error if the build fails
- prune() bool [source]¶
Removes all old versions of the image from the local docker daemon.
returns True if successful, False otherwise
- add_tag(label: ImageLabel, tag: str)[source]¶
Add a new tag to a docker image
- docker_pkg.drivers.get(config: Dict[str, Any], **kwargs) DriverInterface [source]¶
Factory method to get the driver.