I’ve installed Docker in rootless mode on my remote server following this guide:
So I ended with the docker binaries in
If I add this path to my
.bashrc file, it’s ok, I can run docker while I’m connected to my server via ssh on a terminal.
My problem is when from my local computer, I execute docker commands using docker context.
I have a context already setup locally named
remote and it is set to
ssh://<user>@<host>, my local ssh config knows how to connect to the remote machine.
The thing is when you execute docker commands with context, the PATH to
~/bin not set is unknown so the docker binary is not found.
docker --context remote ps
error during connect: Get "http://docker.example.com/v1.24/containers/json": command [ssh -o ConnectTimeout=30 -- remote docker system dial-stdio] has exited with exit status 127, please make sure the URL is valid, and Docker 18.09 or later is installed on the remote host: stderr=bash: line 1: docker: command not found
What can I do about this?
Setting the PATH in .bashrc doesn’t help since is for the logged user on a terminal…
The following seems useless for docker context.
[INFO] Make sure the following environment variable(s) are set (or add them to ~/.bashrc):
Any idea? Thanks!