Importing and validating images in Harbor registry
You can import images into Harbor to preload repositories with commonly used container images.
Before you begin
You must have completed the following tasks:
- Installed Harbor and ensured it is accessible. See Accessing Harbor from DevOps Loop.
- Installed skopeo on the system where you run the bootstrap script.
Procedure
-
Update the bootstrap image list.
Edit the scripts/harbor/bootstrap-images.txt file in the following format:
source_image target_project target_repository target_tagFor example:
docker://docker.io/library/nginx:latest devops nginx bootstrap docker://docker.io/library/alpine:latest devops alpine bootstrap docker://docker.io/library/busybox:latest devops busybox bootstrap -
Run the bootstrap script.
DOMAIN=<DOMAIN> \ NAMESPACE=devops-loop \ RELEASE=devops-loop \ scripts/harbor/bootstrap-images.sh - Verify that the imported images are available in Harbor.
-
Validate image push and pull operations:
docker login harbor.<DOMAIN> docker tag nginx:latest harbor.<DOMAIN>/devops/nginx:test docker push harbor.<DOMAIN>/devops/nginx:test docker pull harbor.<DOMAIN>/devops/nginx:test -
Perform the following steps to verify vulnerability scanning:
- Open Harbor.
- Navigate to the project that contains the uploaded image.
- Enable Automatically scan images on push for the project if it is not already enabled.
- Push a container image to the project.
- Verify that Harbor displays the vulnerability scan results for the image.
Harbor scans the image by using Trivy and displays the detected vulnerabilities.
Results
You have imported the specified images into Harbor and they are available for use.