Deleting an Artifact in Artifact Registry
Delete artifacts from an Artifact Registry repository.
In a repository's detail page:
- Deleted artifacts remain in the Artifacts section with a Deleted state.
- You can filter for all artifacts with a Deleted state.
- Immutable Artifacts
-
You can't replace an immutable artifact:
- When you upload an artifact to an immutable repository, you're not allowed to assign it a deleted artifact's name.
- Mutable Artifacts
-
You can replace a mutable artifact:
- You can upload an artifact to a mutable repository, assigning it a deleted artifact's name.
- If an artifact with the same name exists, the new artifact deletes and replaces the old one.
To delete an artifact, use the
artifacts generic artifact
resource, referenced in Artifact Registry CLI.Get all the commands for
artifacts generic artifact
:oci artifacts generic artifact -h
Use one of following commands to download an artifact to update an artifact:
delete
delete-by-path
Provide the Artifact OCIDDelete an artifact from a repository by providing the artifact OCID in the OCI CLI.
Get help for the
delete
command:oci artifacts generic artifact delete -h
Find the options to provide for the
delete
command:--artifact-id
Delete an artifact by providing its OCID:
oci artifacts generic artifact delete --artifact-id <artifact-OCID>
Example:
oci artifacts repository delete --artifact-id ocid1.genericartifact.oc1..xxx...
Provide the Repository OCID, Artifact Path, and VersionDelete an artifact from a repository by providing the repository OCID, and the artifact path and version, in the OCI CLI.
Get help for the
delete-by-path
command:oci artifacts generic artifact delete-by-path -h
Find the options to provide for the
delete-by-path
command:--repository-id
--artifact-path
--artifact-version
Delete an artifact by providing its repository, path, and version:
oci artifacts generic artifact delete-by-path --repository-id <repository-OCID> --artifact-path <path-defined-for-artifact-in-repo> --artifact-version <version-defined-for-artifact-in-repo>
Example:
oci artifacts generic artifact delete-by-path --repository-id ocid1.artifactrepository.oc1..xxx... --artifact-path project01/my-web-app/artifact-abc --artifact-version 1.0.0
You can delete an artifact in two ways:
- Provide the artifact OCID in DeleteGenericArtifact.
- Provide the repository OCID, artifact path, and version in DeleteGenericArtifactByPath.