Assume that there are two docker host machines A and B and there is a docker image, xyz on machine A. I would like to deploy it to machine B from machine A. How can I do it?

I know that it is possible to operate on containers remotely by setting DOCKER\_HOST as below, but this seems to require the docker image xyz already exists on machine B. Also, creating a tar file from the image xyz and coping it to machine B, and then running it on machine B is another way to do it. I wonder if there is a way in which I can do it directly from machine A? Thanks!

docker -H "ssh://my-user@machine-b" run -i - t xyz