Skip to content

Docker image build and push workflow

This workflow outlines the process for building Docker images for the Bookinfo sample application within the Istio project, pushing them to a Docker Registry, and updating the associated Kubernetes Deployment files^[README.md].

Prerequisites

Before pushing images to the official Istio repository, the PR owner is responsible for performing appropriate testing with images built and pushed to their own personal Docker repository^[README.md].

Local Build

To build the Docker images locally, execute the build script located in the sample directory^[README.md].

cd samples/bookinfo
src/build-services.sh <version> <prefix>

The script requires two arguments^[README.md]: * <version>: The tag to apply to the Docker image. * <prefix>: The target Docker Registry namespace (e.g., docker.io/username).

For example, running src/build-services.sh 1.16.3 docker.io/shamsher31 will build the services and tag the resulting images (e.g., shamsher31/examples-bookinfo-ratings-v2:1.16.3)^[README.md].

Push and Update

Once the local build is successful, you must update the YAML deployment files to reflect the new tag used during the build process^[README.md].

A combined script is provided to automate the building of images, pushing them to the Docker Hub (or specified registry), and updating the YAML files in a single step^[README.md].

./build_push_update_images.sh <version> <prefix>

After running this script, you should verify that the expected tags have been updated in the platform/kube/bookinfo*.yaml files^[README.md].

Validation

After pushing the images, the changes should be deployed to a cluster to verify functionality^[README.md].

  1. Deploy: Apply the updated configuration using kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml^[README.md].
  2. Verify Pods: Ensure all pods reach the Running state^[README.md].
  3. Test Connectivity: Execute a command inside a running Pod to verify the application responds (e.g., using curl productpage:9080/productpage)^[README.md].

If the tests pass with the personal repository images, the PR author may request the official Istio maintainer to build and push the images to the official repository^[README.md].

Sources

^[README.md]