Can the docker private repository and the docker image to be pushed be located on the same machine?

because I only have one linux service, I want to test it and build a private docker repository.
if so, how can I push the image to the local private repository?

Mar.19,2021

can be on the same machine:

docker run -d -p 5000:5000 --name registry registry:2
docker image tag nginx:latest  localhost:5000/nginx:latest
docker push localhost:5000/nginx:latest
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3af2d-2b5b9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3af2d-2b5b9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?