testcontainers-python icon indicating copy to clipboard operation
testcontainers-python copied to clipboard

feat(core): add support for direct Dockerfile builds

Open bricefotzo opened this issue 1 year ago • 1 comments

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, and remove. 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

bricefotzo avatar Mar 09 '24 10:03 bricefotzo

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!

bricefotzo avatar Mar 13 '24 23:03 bricefotzo

Is this obsolete now that we have https://github.com/testcontainers/testcontainers-python/pull/585 ?

black-snow avatar Jun 22 '24 20:06 black-snow

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.

alexanderankin avatar Jun 23 '24 04:06 alexanderankin

https://github.com/testcontainers/testcontainers-python/compare/main...8a1c37050031f211533932f0f91e610ebd8914fa

alexanderankin avatar Jun 24 '24 15:06 alexanderankin