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:
- A simple dockerfile is added to serve build result with Nginx
- 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
- 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