How to upload docker image using API?

How to upload docker image using API?
Version:Sonatype Nexus Repository ManagerOSS 3.32.0-03

I use docker save -o a.tar nginx:v1 to save the image, and then upload it through the API interface with an error of 500.

Am I using it the wrong way?

error as follows:

Hi catcat,
We’re sorry, but uploading Docker images via UI or REST is not supported.

You can upload Docker images to your hosted repository using regular Docker CLI as shown in the documentation: Pushing Images

OK, thank you for your reply

hi,

I am getting the same error as catcatlee when I attempted to upload an image tar file. I am using Nexus OSS 3.43.0-01, is it still not supported?

The documentation in the link below provides the docker.asset parameter for component API. Does that means that it should be supported?
https://help.sonatype.com/repomanager3/integrations/rest-and-integration-api/components-api#ComponentsAPI-Docker

Hi Mei Mei,
The API you linked allows to upload individual assets meaning layers, manifests, tags. An image tar file is not a single asset. If you want to use the API then you have to upload each individual layer, manifest, and tag separately. If you want to just upload whole image then use a Docker client.