All notable changes to this project will be documented in this file.
- Proper handling of possible stdin in logs stream (#769)
- Re-export bollard
- Add examples of
ImageExtusage and coverGenericImage(#747)
- Add
cap_addandcap_dropsupport (#726) - Add support for user-configured labels (#756)
- Reusable containers (#757)
- Add image hook to run commands before ready (#766)
- Update thiserror requirement from 1.0.60 to 2.0.3 (#754)
- Bump the bollard dep to latest (#759)
- Deflake the test
start_containers_in_parallel(#748)
- Expose configured bollard client (#740)
- Copy-to-container interface improvements (#732)
- Replace dirs crate with etcetera (#736)
- [❗] Docker socket detection on unix (#721)
- Add
working_dirtoContainerRequest,ImageExt(#724)
- Added
#![forbid(unsafe_code)]to the library (#722)
- Allow configuring resource ulimits (#714)
- Don't assume docker host is a url (#709)
- Bump the bollard group across 1 directory with 2 updates (#710)
- [❗] Put
reqwestbehindhttp_waitfeature (#705)
- Trim newline char from the mirrored messages (#699)
- Support optional prefix for
LoggingConsumer(#698)
- [❗] Drop
Cloneimpl forContainerRequest(#680) - Exclude image pulling time from startup timeout (#687)
- Waiting for mutiple messages from the same log frame (#688)
- Pass correct log-source for
stderrwait strategy (#692)
- Introduce log consumers (#681)
- Introduce
LoggingConsumerbased onlogcrate (#682) - [❗] Enhance
LogWaitStrategyto wait for message appearance multiple times (#683) - [❗] Introduce
ExitWaitStrategy(#684)
- Get rid of outdated variables naming (#679)
- Relax log level for log producer error (#685)
- Re-configure blocking runtime (#690)
- Avoid spawning log producer without consumers (#689)
- Internal log processing structures (#678)
- Apply clippy suggestion (#693)
- [❗] Use
rustls-tlsas default forreqwest(#672)
- Update examples of
GenericImage::with_exposed_port(#670)
- Add ability to convert
ContainerPorttou16(#664)
- Make
portsmodule public (#665)
- Use separate dropper thread for
current_threadflavor (#666)
- Use multi-threaded runtime for blocking feature (#667)
- [❗] Make
DOCKER_CONFIGusage consistent with Docker CLI (#654)
- [❗] Support UDP and SCTP port mappings (#655)
- Impl
From<u16>forContainerPortwith TCP default (#658) - Support HTTP wait strategy (#659)
- Allow passing
u16toPorts
- Use nightly
rustfmt(#657)
- [❗] Get rid of associated type
ImageArgsand rename tocmd(#649) - Avoid unnecessary owned structs and boxing (#651)
- [❗] Add
ImageExttrait to avoid explicit conversion toRunnableImage(#652) - [❗] Rename
RunnableImagetoContainerRequest(#653) - [❗] Exposed and mapped ports api (#656)
- Preliminary refactoring of
waitstrategies (#661)
- Impl
ErrorforWaitError(#629) - [❗] Extend
execinterface to return logs and exec code (#631) - Ability to access container logs (#633)
- [❗] Switch to fallible API (#636)
- Make container and exec logs
Sendable (#637) - Map container not found error to
eoffor container log streams (#639) - Expose follow flag for
stdoutandstderr(#640) - Add ability to read container logs into
Vec(#641) - [❗] Add container startup timeout with default of 1 minute (#643)
- Fix clippy warning without features enabled (#632)
- [❗] Drop re-export of
CgroupnsModeaccessible throughcore(#630) - [❗] Drop previously deprecated
get_host_ip_address(#628) - [❗] Return
PortNotExposederror fromContainerState::host_port_*(#644)
get_hostforunixandnpipedocker hosts (#621)
- Extend
WaitForforExecCommand(#622)
- Add
get_hosttoContainerand deprecateget_host_ip_address(#618) - Allow cgroupns-mode and userns-mode to be configured (#605)
- Correct drop of a network for sync container (#612)
- Correct default for
get_host_ip_addressin case ofunixornpipe(#613)
- Update
serde-java-propertiesto0.2.0(#614)
- Properly expose mapped ports (#610)
- Introduce
properties-configcargo feature (#608) - Support docker auth configuration for image pulling (#609)
- Expose mount-related types (#603)
- Fix
docsrsattributes
- Use the binds option instead of volumes for mounts (#581)
- Mention a way to preserve running containers (#586)
- Support for docker cli flag
--add-host(#547) - Allow to override args in a
RunnableImage(#558) - Add
nameparameter toRunnableImage(#549) - [❗] Container-centric API with refactored underlying layer (#575)
- Add ability to pull-image explicitly (#579)
- Remove
spectralfromdev-dependencies(#526) - Update reqwest requirement from 0.11.14 to 0.12.3 (#569)
- Update bollard and bollard-stubs (#574)
- Reuse workspace level configs (#568)
- [❗] Api for mounts and volumes (#596)
- Derive
Defaultto fix clippy lint (#525) - Actualize formatting configs (#567)
- Enable
StdExternalCrategrouping
- Added
privilegedparameter toRunnableImage - Added
shm_size(shared memory size) parameter toRunnableImage - Added logging of an error when starting a container fails
Container::execchanged to be synchronous and returnExecOutput- MSRV is now 1.63.
- Fixed
get_bridge_ip_addressnot to use outdated properties Dockertrait is declared to beSend + Sync
- Removed all pre-defined images from the library to escape unbounded maintenance work. See testcontainers#471 for details.
- Removed explicit support for podman. See testcontainers#422 for details.
- Added
watchdogfeature that spawns a background thread keeping track of docker containers that are started by the test suite and removes them in the case of aCTRL+Corkillof the test process. - Introduced
Container::get_host_port_ipv4,Container::get_host_port_ipv6,ContainerState::host_port_ipv4, andContainerState::host_port_ipv6to better handle automatically assigned ports. Docker may bind the same exposed container port to different host ports on0.0.0.0and::, depending on influences from the environment.
Container::get_host_portandContainerState::host_portare now deprecated in favor of the new IPv4- and IPv6-specific methods.- MSRV is now 1.60.
- A new client implementation that talks to the Docker daemon via HTTP.
This implementation is available as
testcontainers::clients::Httpand provides an async interface. As of now, this implementation is guarded behind theexperimentalfeature-flag and not yet guaranteed to work flawlessly. - Allow using
podmanCLI in addition todocker - The
TESTCONTAINERSenvironment variable to control what happens to containers and networks at the end of a test. The default value isremovewhich deletes all containers and networks that were used in the test. By setting the value tokeep, containers and networks will not be deleted but kept running. You will have to stop and delete those yourself eventually. - Upgrade default bitcoin-core image version to 0.21.0. This allows us to remove
-debugfor bitcoind and replace it with-startupnotify=echo .... More details on bitcoind 0.21.0 can be found here. Note: This release also removed the default wallet. expose_portfunctionality toImagetrait.Google Cloud SDKimageRabbitMQimageWaitFor::Healthcheckcontainer ready condition, which corresponds with the healthcheck status.MinIOimage
- How images express when a container is ready: Instead of implementing
wait_until_ready, images now need to implementready_conditionswhich returns a list ofWaitForinstances. - Return value of
get_host_portfromOption<u16>tou16. If the port cannot be resolved, this function will now panic. - MSRV bumped to 1.46.
- Make
Dockertraitpub(crate). This reduces the API surface of the crate which allows for fewer breaking changes in the future. All functionality fromDocker(start, stop, rm, and ports) is available on a container directly. descriptoris broken down intonameandtagwithinImagetrait.- Bump
MongoDB-image default version to5.0.6.
DYNAMODB_ADDITIONAL_SLEEP_PERIODvariable fromdynamodb_localimage. Previously, we had a fallback of 2 seconds if this variable was not defined. We now wait for 2 seconds unconditionally after the specified message has been found.- Support for the
KEEP_CONTAINERSenv variable. The functionality ofKEEP_CONTAINERS=trueis superseded byTESTCONTAINERS=keep. with_entrypointfrom theImagetrait. This functionality is not used within the library. Images that need this kind of customization can always implement it on their own type directly but there is no need to force it onto them.Image::EnvVarsandImage::Volumesassociated types. The respective functionsImage::env_varsandImage::volumesstill exist but now return a trait object that must implementIterator<Item = (&String, &String). This allows us to provide a default implementation which reduces the boilerplate in defining new images.argsandwith_argsfromImagetrait.
- Removing a docker container did not error if failed. This was fixed by asserting the daemon's response instead of
just the status code: If a docker container was removed correctly using
rm -f -v <ID>is printed on stdout. can either be the container name or its ID which is used within testcontainer-rs. - Fixed clippy warnings of camel case names containing a capitalized acronym.
- Allow custom version for postgres image
- Remove
derivativedependency OrientDBimageZookeeperimage
- Move port mapping logic to
RunArgsinstead of each Image.
Docker::run_with_argsmethod. This allows naming a container and assigning it to a specific docker network. The docker network will be created if it doesn't exist yet. Once the client is dropped, the network will be removed again if it has previously been created. A network that already existed will not be removed.- Address-type argument to
coblox/bitcoin-coreImage. We are settingbech32as a default here. This is different from the default ofbitcoind.
- Block the thread until containers have been successfully removed. Previously, this was done in a fire-and-forget way and hence led to containers not being removed in certain situations.
- MSRV is now 1.41.0
- Mongo image.
- Support for the
fallbackfeeargument for thebitcoin-coreimage. - Ability to customize the
entrypointused by the image. - Ability to start a container once stopped.
- MSRV bumped to 1.36 from 1.32.
- Change postgres image authentication POSTGRES_HOST_AUTH_METHOD rather than username and password.
- Bumped bitcoin-core default tag to 0.20.0.
- A changelog
- Support volumes on containers
- Breaking:
Container#get_host_portnow only accepts au16instead of au32.u16captures all possible port values.
- Provide a default password for the postgres image. There seems to be an unfortunate breaking change in the postgres image that we need to cater for.