Build and push artifacts and images
There are many ways you can use Harness CI to upload artifacts.
You can use Harness CI to build image, push image, and upload artifacts, such as Docker images or test results. Build and Push steps build your codebase and then push the resulting artifact to a container registry or cloud storage repo. Upload Artifact steps upload any artifact.
Build and push
Build and Push steps build your codebase and then push the artifact to a repo. You can:
For other non-Docker upload locations, you can use a script in a Run step to build and upload the artifact.
Kubernetes cluster build infrastructures require root access
With Kubernetes cluster build infrastructures, Build and Push steps use Chainguard's maintained Kaniko fork. Other build infrastructures use drone-docker. Kaniko can run as non-root in many cases. Root access is only required when your Dockerfile performs privileged operations (e.g., installing system packages, modifying root-owned directories).
If your build runs as non-root (runAsNonRoot: true), and you want to run the Build and Push step as root, you can set Run as User to 0 on the Build and Push step to use the root user for that individual step only.
If your security policy doesn't allow running as root, go to Build and push with non-root users.
Pull images
You can pull and run images in your pipelines by declaring them in your steps' Image setting. For example, you could pull and run an image in a Background step or Run step.
Upload artifacts
Upload Artifacts steps upload artifacts. These steps don't include build commands. You can:
Run any upload script in a Run step or use plugins.
Download artifacts
You can use Run steps and Plugin steps to download artifacts into your pipeline workspace.
For example:
Troubleshoot building and pushing artifacts and images
Go to the CI Knowledge Base for questions and issues related to building and pushing images or uploading artifacts, such as:
Last updated
Was this helpful?