github.com/darmach/terratest@v0.34.8-0.20210517103231-80931f95e3ff/examples/docker-hello-world-example/README.md (about) 1 # Docker "Hello, World" Example 2 3 This folder contains a `Dockerfile` to build a very simple Docker image—one which contains a text file with the 4 text "Hello, World"!—to demonstrate how you can use Terratest to write automated tests for your Docker images. 5 6 Check out [test/docker_hello_world_example_test.go](/test/docker_hello_world_example_test.go) to see how you can write 7 automated tests for this simple Docker image. 8 9 10 11 12 ## Building the Docker container 13 14 1. Install [Docker](https://www.docker.com/) and make sure it's on your `PATH`. 15 1. Run `docker build -t gruntwork/docker-hello-world-example .`. 16 1. Run `docker run -it --rm gruntwork/docker-hello-world-example cat /test.txt`. 17 1. You should see the text "Hello, World!" 18 19 20 21 22 ## Running automated tests against the Docker container 23 24 1. Install [Docker](https://www.docker.com/) and make sure it's on your `PATH`. 25 1. Install [Golang](https://golang.org/) and make sure this code is checked out into your `GOPATH`. 26 1. `cd test` 27 1. `go test -v -run TestDockerHelloWorldExample`