Abstract
- Convert Dockerfile to Docker Container
- The docker command starts with
docker build
--build-arg
Allows us to pass dynamic values to Docker Engine for the building process. Not Environment Variable, that is set with ENV!
Great for frontend build which only needs inputs at container build stage, not when container is running
Docker Build Cache
- Each instructions inside Dockerfile is cached for faster Docker Build
Build app dependencies before app
For example, we can copy & build the
package.json
first. Since dependencies usually don’t really change. If we include the dependencies installation with the main application. We need to re-install the dependencies whenever there is a change to the application