The Testcontainers project

If you're a Java developer, then there is a nice project called Testcontainers (https://testcontainers.org). In their own words, the project can be summarized as follows:

"Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in  Docker container."
To experiment with Testcontainer follow along:
  1. First create a testcontainer-node folder and navigate to it:
$ mkdir ~/fod/ch07/testcontainer-node && cd ~/fod/ch07/testcontainer-node
  1. Next open VS Code from within that folder with code .. Create three subfolders, database, api, and tests, within the same folder. To the api folder, add a package.json ...

Get Learn Docker - Fundamentals of Docker 19.x - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.