Skip to main content

Build/Publish Docker Image

This tutorial explains how to build a docker image and publish to docker hub

We demonstrate the setup with a tutorial project. It is a react project created with npx create-react-app. In this project:

  1. A simple dockerfile is added to serve build result with Nginx
  2. A CI job is added in the build spec to build and publish the docker image. In this job:
  • the checkout step clones the repository into job workspace
  • the build step tests and creates production build
  • the publish docker image step builds and publishes the docker image
  1. Without job executor specified, the job will be executed by first applicable executor which is configured on the demo site with registry login able to push to dockerhub