Push Docker Image to Server[Docker Server Tunel] With out using DockerHub or Any Docker Registry
A guide to Push Docker image from Local Machine to Remote machine
“Developer Friendly Deployment Step’s”
This article is focused on the image push of docker images build in locally to remote server without using the DockerHub or any Docker Registry in simple developer-friendly configurations.
Prerequisites to Proceed Further
- Must have Docker Implemented Project
- Basic in Linux Commands
- Basic in Docker commands
- Remote server with ssh access using username and password
Build Docker image in Local Machine
Go to the Project root folder and build the docker image in your local machine, if you don’t have any project please clone the below Dockerized project and take the build.
https://github.com/AkshayKrison/demo-node-docker-azure.git
For taking the docker build run the below command
docker build -t akshaykrisondevops/node-ec2 .
you can change the repository name as per yours
Wait until the build complete in your local machine…
Next check the build-ed image using the docker image command
docker images
Now you can saw the docker image is successfully build-ed in your local machine next we want to push the docker images to our remote server with out use of any registry services
Docker Push to Remote Server From Local Machine
For pushing the locally build docker image you have to run the below commands
docker save akshaykrisondevops/node-ec2:latest | ssh -C root@<your_server_ip> docker load
- docker save will produce a tar archive of one of your docker images (including its layers)
-C
is for ssh to compress the data stream- docker load creates a docker image from a tar archive
Enter the Remote Server Password and Wait until Operation success it will take little bit time..
After getting this successful Lets check in to the server and check the image is loaded successfully or not for that login to the remote server via ssh and run docker images in to it
docker images
All Done…….