From the course: Certified Kubernetes Security Specialist (CKS) Cert Prep

Unlock this course with a free trial

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

Use image creation good practices

Use image creation good practices

- In this demo, we're going to take a look at being able to reduce the file sizes of a Docker container. Now this is a great way to be able to not only make it more efficient as far as in your Kubernetes environment, but it also can reduce the attack surface. So let's take a look at this. Now, the first thing we'll do is we'll take a look at what files we're dealing with. So I'm going to do a quick directory of this particular set of files. Now I've got numerous Docker files in here and I have an application that's a Node.js application. So let's go ahead and take a quick look at that. So we'll do a look at apps.js. So as you can see here, all this is is literally just setting up a port of 3000 to be able to respond to, it's going to do a hello world back when you connect up, and it's going to just use local host to be able to communicate out. So it's a very simple application. Now you also have the packages component, which is what's used during the build. So here we can use the…

Contents