Docker api: push an image to docker hub private repository

I can create a docker registry on 5000 port mapped to 5000 port on my local system. docker configuration file changed to --insecure-registry localhost:5000 to make the connection insecure. How can I push images to my private repo using docker api command.

  • Jenkins With Nginx Reverse Proxy And Resolver
  • how to mount localhost volume to a docker container using docker-compose
  • How to enable code running in a docker container access files on the host on which the container is running?
  • Do Docker Linux Images Contain Kernels?
  • What are conceptual and practical differences between containers (i.e. docker) and encapsulated packages (i.e. flatpack, snap)?
  • In dockerfile after create or copy file or directory in RUN statement it not/doesn't exists
  • What is the best way to manage cert/key for Docker containers that must talk TLS
  • Pushing private repository to Docker Hub fails: HTTP code 504 while uploading metadata
  • docker-ce 17.06.0-ce failed to pull from private registry mirror
  • Unable to connect to server when running docker django container?
  • Using S3FS in a docker container ran by the mesos containerizer
  • Kubernetes 1.2.2: api-server fails: can't find mounted certs for TLS on etcd
  • One Solution collect form web for “Docker api: push an image to docker hub private repository”

    For API I guess you can use this

    Push an image on the registry
    POST /images/(name)/push

    Example request:

    POST /images/registry.acme.com:5000/test/push HTTP/1.1
    Query Parameters:
    

    tag – The tag to associate with the image on the registry. This is optional.

    Ref: https://docs.docker.com/reference/api/docker_remote_api_v1.19/

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.