Skip to content

v0.16.0

Compare
Choose a tag to compare
@github-actions github-actions released this 27 Apr 21:09
· 86 commits to main since this release
7641fbc

Details

Bug Fixes

  • Use the binds option instead of volumes for mounts (#581)

Documentation

  • Mention a way to preserve running containers (#586)

Features

  • Support for docker cli flag --add-host (#547)
  • Allow to override args in a RunnableImage (#558)
  • Add name parameter to RunnableImage (#549)
  • [❗] Container-centric API with refactored underlying layer (#575)
  • Add ability to pull-image explicitly (#579)

Miscellaneous Tasks

  • Remove spectral from dev-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)

Refactor

  • [❗] Api for mounts and volumes (#596)

Styling

  • Derive Default to fix clippy lint (#525)
  • Actualize formatting configs (#567)
  • Enable StdExternalCrate grouping

Migration guide

  • Sync API migration (Cli client)
    • Add blocking feature
    • Drop all usages of clients::Cli
    • Add use testcontainers::runners::SyncRunner;
    • Replace client.run(image) with image.start()
  • Async API migration (Http client)
    • Remove experimental feature
    • Drop all usages of clients::Http
    • Add use testcontainers::runners::AsyncRunner;
    • Replace client.run(image) with image.start()
  • ENV variable TESTCONTAINERS was renamed to TESTCONTAINERS_COMMAND and still accepts either remove (default to remove containers on drop) or keep
  • ExecCommand interface was changed to builder-like:
    • use ExecCommand::new(cmd) instead of ExecCommand { ... }
    • cmd is Vec<String> now, so make sure your commands are separated
    • use any of the new methods to check the result with_container_ready_conditions & with_cmd_ready_condition
  • If your Image implements volumes method:
    • rename method to mounts
    • wrap all existed "volumes" into Mount::bind_mount(host_path, container_path)
  • If your code uses RunnableImage::with_volume
    • replace the call with RunnableImage::with_mount
  • If your code uses GenericImage::with_volume
    • replace the call with GenericImage::with_mount

Docker host resolution

We have completely switched to an http client with special host resolution logic.
The host is resolved in the following order:

  1. Docker host from the tc.host property in the ~/.testcontainers.properties file.
  2. DOCKER_HOST environment variable.
  3. Docker host from the "docker.host" property in the ~/.testcontainers.properties file.
  4. Else, the default Docker socket will be returned.