From the course: Cloud Native Development with Node.js, Docker, and Kubernetes

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Build a production Dockerfile

Build a production Dockerfile

From the course: Cloud Native Development with Node.js, Docker, and Kubernetes

Start my 1-month free trial

Build a production Dockerfile

- [Instructor] In the previous two videos, we used the CloudNativeJS project and its Dockerfile templates in order to build a Dockerfile and a Docker image for our application. And a Dockerfile tools and a tools image for our application. The Docker Project also provides a Dockerfile run. And that produces an optimized run image for our node.js application. In order to install the Dockerfile run, we follow the same step as previously using wget, to get the Dockerfile. We go into our project directory and then run the wget command to get the Dockerfile run. Let's take a look at that Dockerfile to see how it's different from the ones we've used previously. This Dockerfile run starts from a node 10 image as we had before. And runs a number of steps. The one crucial difference is it has a second from statement. What this Dockerfile does, is it first installs a number of OS updates then copies in our package.json file and does an install. It then does a second build. Where it starts from…

Contents