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
checkoutstep clones the repository into job workspace - the
buildstep tests and creates production build - the
publish docker imagestep 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