Test a Docker image with TerraTest

In this story, we will see how to test a Docker image. We will create a file in the Docker image and we will check this file exists and has the expected content. For that, we will use TerraTest. This example is based on the official example of the TerraTest git repository.

Before to start, we have to install Go. For that, go to https://go.dev/dl/ and install the binary.

Now, we will create a Docker image, we will create a test, and we will run the test.

Create a Docker image

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Bruno Delb

Bruno Delb

Blockchains, DevOps, Agile Coaching, development, testing, Cloud, Management 3.0, ITIL. It defines me.