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

--

--

--

The Open DevOps Academy shares practices, experiences, and ideas about many domains of DevOps.

Recommended from Medium

Ending Monorepo Vs Polyrepo Debate

Less is more with serverless, pt. 1

API Gateway Custom Lambda Authorizer using Cognito, Python, and Serverless

Helm — Helm Charts Overview

6 Best Free Online Courses for AWS Certification Exams Preparation in 2022

6 Best Free Online Courses for AWS Certification Exams Preparation

Installation of NS2 with UM-OLSR in Ubuntu 16.04

Development Update 28/08

How to add two numbers without using (+) operator?

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.

More from Medium

How to Deploy a Dockerfile through a single node Kubernetes Cluster

How to fetch multiple host names from config file management in Jenkins pipeline groovy script

Recipe OSS: How to implement CORS rules? (Alibaba Cloud)

GITLAB, Jenkins and GKE kubernetes pipeline