feat(core): add support for direct Dockerfile builds
Feature: Introduce DockerImage class for flexible image handling
Overview:
This PR introduces the DockerImage class, aimed at simplifying the way testcontainers handles Docker images. DockerContainer now support for the attribute image: DockerImage and str.
Motivation:
- Need for simpler and more dynamic setup
- Enhances testing flexibility and efficiency, closely aligning with the Java version's capabilities.
Implementation Details:
- DockerImage class: Centralizes image-related operations, offering methods like
from_dockerfile,from_image,build,pull,get, andremove. This design simplifies the interface for users, making it straightforward to build or pull images as needed. - Flexibility and Extensibility: The new class structure is designed to be easily extendable, allowing for future enhancements such as additional Dockerfile statements, build arguments, and so on.
fixes #83
Hello @alexanderankin !
Just to notice you that I cleaned up my commit history then I only have one commit now. Open and ready for feedbacks and changes requests. Best regards!
Is this obsolete now that we have https://github.com/testcontainers/testcontainers-python/pull/585 ?
I haven't had time to go through and determine just how far away this and the other implementation is from my ideal version of it (also haven't had time to formulate this) so I am leaving open in case any ideas that shouldn't get lost. If I should close, I can close.
https://github.com/testcontainers/testcontainers-python/compare/main...8a1c37050031f211533932f0f91e610ebd8914fa