I have remote machine. I enter into it in two steps:
1) ssh -A login@server.com
Then inside this machine I enter into my remote machine:
2)ssh -A mymachine
This remote machine doesn't have a public IP
which I can specify in DOCKER_HOST=xx.xx.xx.xx
.
How can I configure my docker in such way that my laptop would have a docker client
and that remote machine would have docker
server
daemon?
The docker client/server API needs a reachable API. Just as you can't run a web server on mymachine and access it with a web browser on your laptop, you can't configure DOCKER_HOST without an IP you can reach.
Your options that I can think of include:
ssh -L 2376:mymachine:2376 login@server.com
and then export DOCKER_HOST=localhost:2376
(I haven't tested this, and it requires sshd to permit the option).