We are in the process of setting up docker engine with local registry server. an . . .

Prasad:
We are in the process of setting up docker engine with local registry server. any pointer as I need to install docker and local registry in air tight environment (with out internet access), preferably scripting way.
In particular $

docker run -d -p 5000:5000 --restart=always --name registry registry:2

is the command to start local registry. How to avoid reference to registry image as I believe it need be pulled from dockerhub, which is not possible in my local environment with no internet access.
Thanks in advance!

Karim Meslem:
one way to go about, but has some assumptions:

pull the registry:2 image from dockerhub to a machine with internet access that has docker desktop running, e.g. your laptop.
the image will show if you do a docker image ls
Followed by docker save <IMAGE ID> -o myregistry.tar this will pack the image into a tar archive.

Now I’m assuming that you can in some way transfer that tar file to the airgapped box with scp or sftp.
When that is done, login to the box where you transferred the tar file to.
now you can have docker unpack the archive with:
docker save -i <path-to-tar-archive>

Karim Meslem:
now If you do docker image ls you’ll see the image id listed. it may need to be followed by a docker tag <Image ID>to give the image a name and a tag, e.g. registry:2

now you can proceed with:
docker run -d -p 5000:5000 --restart=always --name registry registry:2