Push Docker Image to Server[Docker Server Tunel] With out using DockerHub or Any Docker Registry

Akshay Krison
3 min readMar 30, 2022

--

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

  1. Must have Docker Implemented Project
  2. Basic in Linux Commands
  3. Basic in Docker commands
  4. 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

docker image build command

Wait until the build complete in your local machine…

docker image building

Next check the build-ed image using the docker image command

docker images
docker images show

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
docker push to remote from local

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…….

--

--