Skip to content

Remove Image from Registry ​

This tutorial shows how to remove a previously pushed image to the registry using the pure registry API or skopeo.

Prerequsities ​

Steps ​

  1. Enable the image manifests deletion functionality by changing the .spec.storage.deleteEnabled flag to true:
bash
kubectl apply -n kyma-system -f - <<EOF
apiVersion: operator.kyma-project.io/v1alpha1
kind: DockerRegistry
metadata:
    name: default
    namespace: kyma-system
spec:
    storage:
        deleteEnabled: true
EOF

Once the DockerRegistry CR becomes Ready, you see the updated .status.deleteEnabled field with a new value.

yaml
...
status:
    deleteEnabled: true
  1. Push the image to the registry:
bash
kyma registry image-import <IMAGE_NAME>:<IMAGE_TAG>
  1. Port-forward the registry service to another terminal:
bash
kubectl port-forward -n kyma-system svc/dockerregistry 5000:5000
  1. Export registry credentials:
bash
export DR_USERNAME=$(kubectl get secret -n kyma-system dockerregistry-config -o jsonpath="{.data.username}" | base64 -d)
export DR_PASSWORD=$(kubectl get secret -n kyma-system dockerregistry-config -o jsonpath="{.data.password}" | base64 -d)