how to build an image from a dockerfile code example Example 1: docker build image docker build --tag hello . Example 2: docker build docker build -t [tag] .