docker build a new image code example Example 1: docker build image docker build --tag hello . Example 2: how to build docker image docker build -t image-name