Skip to content

feat: reusable containers #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open

Conversation

matthiasschaub
Copy link
Collaborator

No description provided.

@matthiasschaub matthiasschaub changed the title feat: reuse containers feat: reusable containers Jul 3, 2024
@matthiasschaub matthiasschaub force-pushed the reusable_containers branch 2 times, most recently from 44660f1 to 74c8df1 Compare July 3, 2024 12:04
matthiasschaub and others added 18 commits July 8, 2024 09:40
do not create Ryuk cleanup instance if reuse enabled and container has
been start with `with_reuse`
🤖 I have created a release *beep* *boop*
---


##
[4.9.1](testcontainers/testcontainers-python@testcontainers-v4.9.0...testcontainers-v4.9.1)
(2025-01-21)


### Bug Fixes

* milvus healthcheck: use correct requests errors
([testcontainers#759](testcontainers#759))
([78b137c](testcontainers@78b137c))
* **mysql:** add dialect parameter instead of hardcoded mysql dialect
([testcontainers#739](testcontainers#739))
([8d77bd3](testcontainers@8d77bd3))
* **tests:** replace dind-test direct docker usage with sdk
([testcontainers#750](testcontainers#750))
([ace2a7d](testcontainers@ace2a7d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…estcontainers#769)

When invoking `.start()` multiple times on the same `DockerContainer`
instance, the call fails with `ValueError: The org.testcontainers
namespace is reserved for internal use` error.

Example code:

```
from testcontainers.core.container import DockerContainer
container = DockerContainer("alpine:latest").with_kwargs(labels={})
container.start()
container.stop()
container.start()
```

The fix is to update labels for the container in a copy of the
user-provided dictionary, so that:
* the code doesn't mutate user structures
* avoid side effects, allowing for multiple .start() invocations
Fixed a typo which I ran into while working a bugfix.
testcontainers#766)

@alexanderankin We already discussed last year that we only want to
support the latest Keycloak version.

I added the `latest` tag to test parameterization so we get a better
feedback for future Keycloak updates.

Fixes testcontainers#764

---------

Co-authored-by: David Ankin <[email protected]>
Make sure the test covers the intended behaviour. Previously it was
executing the create_labels function without actually verifying there
are no side effects.
use convention for getting ip and port instead of hardcoding DIND mode
🤖 I have created a release *beep* *boop*
---


##
[4.9.2](testcontainers/testcontainers-python@testcontainers-v4.9.1...testcontainers-v4.9.2)
(2025-02-26)


### Bug Fixes

* Change env var disabling OpenSearch security plugin
([testcontainers#773](testcontainers#773))
([2620d7f](testcontainers@2620d7f))
* **core:** create_label test
([testcontainers#771](testcontainers#771))
([7517297](testcontainers@7517297))
* **core:** multiple container start invocations with custom labels
([testcontainers#769](testcontainers#769))
([3e783a8](testcontainers@3e783a8))
* **keycloak:** Fixed Keycloak testcontainer for latest version v26.1.0
([testcontainers#766](testcontainers#766))
([b1642e9](testcontainers@b1642e9))
* **scylla:** scylla get cluster method
([testcontainers#778](testcontainers#778))
([46913c1](testcontainers@46913c1))


### Documentation

* Fixed typo in CONTRIBUTING.md
([testcontainers#767](testcontainers#767))
([f0bb0f5](testcontainers@f0bb0f5))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This will address the Security issue reported on testcontainers#786
As recommended, `tj-actions/changed-files` was replace replaced with
[path-filter](https://github.com/dorny/paths-filter)

---------

Co-authored-by: David Ankin <[email protected]>
Add new SocatContainer at testcontainers module that
can be used along with other modules as a helper.

---------

Co-authored-by: David Ankin <[email protected]>
alexanderankin and others added 9 commits April 2, 2025 12:02
🤖 I have created a release *beep* *boop*
---


##
[4.10.0](testcontainers/testcontainers-python@testcontainers-v4.9.2...testcontainers-v4.10.0)
(2025-04-02)


### Features

* Add SocatContainer
([testcontainers#795](testcontainers#795))
([2f9139c](testcontainers@2f9139c))


### Bug Fixes

* **ollama:** make device request a list
([testcontainers#799](testcontainers#799))
([9497a45](testcontainers@9497a45))
* **security:** Update track-modules job
([testcontainers#787](testcontainers#787))
([f979525](testcontainers@f979525))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ontainers#789)

the `with_command` function can actually take an argument with type
`list[str]`.

Co-authored-by: amirhosein <[email protected]>
Fix: testcontainers#706,
testcontainers#614

Now when using kwargs in the Image API, the params are passed correctly
into the build

```python
with DockerImage(path=dir, tag="test", buildargs={"MY_ARG": "some_arg"}) as image:
```

Added relevant test + updated docstring to better reflect the usage
…tainers#785)

closes testcontainers#745 

if the docker compose command is provided, use that instead of default
one.

Co-authored-by: amirhosein <[email protected]>
…ners#803)

Trying to improve docs reliability for "latest" version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants