Followers

Connect Docker Client to Remote Docker Host

This article will help to connect a Docker client to a remote Docker host Server. Prerequisites: Docker Server is installed on remote Docker...

This article will help to connect a Docker client to a remote Docker host Server.


Prerequisites:

Docker Server is installed on remote Docker host server 

Docker Client is installed on the client machine.

Docker Client must have ssh connectivity with the remote server


To Setup the ssh key

On Docker Client 

$ ssh-keygen

$ cat /<<user>>/.ssh/id_rsa.pub

copy these contents and got to remote server

On Docker Remote Server

append the content of client's ssh key to /<<user>>/.ssh/authorizedkeys

On Docker Client 

export DOCKER_HOST=ssh://<<user>>@<<RemoteIP>>

Now your client is connected to Remote Host Machine.

if you run docker commands it will connect to Remote Docker server.


How to disconnect to Remote server

$  unset DOCKER_HOST




COMMENTS

BLOGGER: 4
  1. Not able to connect docker server from Docker client machine. Please suggest.

    Server - 172.31.28.37 (private) 3.93.73.204 (Public)
    Client - 172.31.24.217 (Private) 34.224.156.201 (Public)

    ubuntu@ip-172-31-24-217:~/.ssh$ export DOCKER_HOST=ssh://ubuntu@172.31.28.37
    ubuntu@ip-172-31-24-217:~/.ssh$ docker --version

    Command 'docker' not found, but can be installed with:

    sudo snap install docker # version 19.03.11, or
    sudo apt install docker.io

    See 'snap info docker' for additional versions.

    ------ Checking Connection ----------
    ubuntu@ip-172-31-24-217:~/.ssh$ ssh ubuntu@172.31.28.37
    Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 5.3.0-1035-aws x86_64)

    * Documentation: https://help.ubuntu.com
    * Management: https://landscape.canonical.com
    * Support: https://ubuntu.com/advantage

    System information as of Tue Sep 29 19:35:51 UTC 2020

    System load: 0.0 Processes: 94
    Usage of /: 21.2% of 7.69GB Users logged in: 1
    Memory usage: 20% IP address for eth0: 172.31.28.37
    Swap usage: 0%


    36 packages can be updated.
    31 updates are security updates.

    New release '20.04.1 LTS' available.
    Run 'do-release-upgrade' to upgrade to it.


    Last login: Tue Sep 29 19:27:15 2020 from 34.224.156.201
    ubuntu@ip-172-31-28-37:~$

    ReplyDelete
    Replies
    1. First you need to install docker on client system

      Delete
  2. Secure Speech Recognition kiosk CenterThank you so much uploading this post.it is very helpful to us. Great work!

    ReplyDelete
  3. wonderful post. this is very well written and unique. Thank you for sharing this post here. keep sharing this in future. Managed Devops Solutions

    ReplyDelete

Name

Ansible,6,AWS,1,Azure DevOps,1,Containerization with docker,2,DevOps,2,Docker Quiz,1,Docker Swarm,1,DockerCompose,1,ELK,2,git,2,Jira,1,Kubernetes,1,Kubernetes Quiz,5,SAST DAST Security Testing,1,SonarQube,3,Splunk,2,vagrant kubernetes,1,YAML Basics,1,
ltr
item
DevOpsWorld: Connect Docker Client to Remote Docker Host
Connect Docker Client to Remote Docker Host
DevOpsWorld
https://www.devopsworld.co.in/2020/09/connect-docker-client-to-remote-docker.html
https://www.devopsworld.co.in/
https://www.devopsworld.co.in/
https://www.devopsworld.co.in/2020/09/connect-docker-client-to-remote-docker.html
true
5997357714110665304
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content