Building the new Docker Image

Follow the instructions to use Docker to build a custom image.

A new custom Docker image can be built on any host where Docker binaries are installed, source images are available, and OS repositories and other package repositories are available.

  1. To install binaries run this command on the host where you want to build the new image.
    docker build -t <image-name>:<tag> . -f Dockerfile
  2. Add the --network=host option to the build command if your Dockerfile makes any outside connection (for example, apt-get, update, pip install, curl).
    docker build --network=host -t <image-name>:<tag> . -f Dockerfile