From the course: Kubernetes: Your First Project (2021)

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Solution: Write a teardown make target

Solution: Write a teardown make target - Kubernetes Tutorial

From the course: Kubernetes: Your First Project (2021)

Solution: Write a teardown make target

- Let's solve this challenge. First, we'll need to know how to stop running docker containers. Now, if I look at docker dash dash help, you'll see that there is a stop command right here that will stop one or more running containers. That seems like an appropriate command to use. So we'll probably need to use this. Let's take a look at our make file here. In our make file we named the container explorecalifornia.com since it came after the dash dash name command light option here. However, because this container has the dash dash RM option set, once we stop the container it will automatically be removed. So with those three facts intel, let's go ahead and create a new target called stop underscore website. Now you may have called this something different in your challenge, and that's totally fine. Now, if you recall, if we tried to run this and we created a file called stop website, this target wouldn't actually run…

Contents