Addprocs gives connection refused to a docker container on raspberry pi

I have a docker container running on my Ubuntu 18.04 laptop and a docker container on my Raspberry Pi 3+. Julia is installed the same on both containers (/home/rob/julia/julia-1.3.1/bin/). The Dockerfile I use for both containers comes from Dockerize an SSH service but use FROM ubuntu:18.04. The RasPi container is created with the command docker run -d -p 2222:22 --name test_sshd eg_sshd.

I can connect from the Julia shell passwordless to the RasPi container but get an error when using addprocs.

How could I use addprocs to be successful?

shell> ssh rob@xxx.xxx.xxx.91 -p 2222
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.9.35-v7+ armv7l)

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

This system has been minimized by removing packages and content that are
not required on a system that users do not log into.

To restore this content, you can run the 'unminimize' command.
Last login: Fri Mar  6 10:31:17 2020 from xxx.xxx.xxx.11
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

Using addprocs with the same address as for the shell: xxx.xxx.xxx.91

julia> using Distributed

julia> addprocs([("rob@xxx.xxx.xxx.91:2222", 1)]; exeflags=`--project=$(Base.active_project())`)
ERROR: TaskFailedException:
IOError: connect: connection refused (ECONNREFUSED)
Stacktrace:
 [1] worker_from_id(::Distributed.ProcessGroup, ::Int64) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Distributed/src/cluster.jl:1059
 [2] worker_from_id at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Distributed/src/cluster.jl:1056 [inlined]
 [3] #remote_do#156 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Distributed/src/remotecall.jl:482 [inlined]
 [4] remote_do at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Distributed/src/remotecall.jl:482 [inlined]
 [5] kill at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Distributed/src/managers.jl:534 [inlined]
 [6] create_worker(::Distributed.SSHManager, ::WorkerConfig) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Distributed/src/cluster.jl:581
 [7] setup_launched_worker(::Distributed.SSHManager, ::WorkerConfig, ::Array{Int64,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Distributed/src/cluster.jl:523
 [8] (::Distributed.var"#43#46"{Distributed.SSHManager,Array{Int64,1},WorkerConfig})() at ./task.jl:333
Stacktrace:
 [1] sync_end(::Array{Any,1}) at ./task.jl:300
 [2] macro expansion at ./task.jl:319 [inlined]
 [3] #addprocs_locked#40(::Base.Iterators.Pairs{Symbol,Any,NTuple{4,Symbol},NamedTuple{(:tunnel, :sshflags, :max_parallel, :exeflags),Tuple{Bool,Cmd,Int64,Cmd}}}, ::typeof(Distributed.addprocs_locked), ::Distributed.SSHManager) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Distributed/src/cluster.jl:477
 [4] #addprocs_locked at ./none:0 [inlined]
 [5] #addprocs#39(::Base.Iterators.Pairs{Symbol,Any,NTuple{4,Symbol},NamedTuple{(:tunnel, :sshflags, :max_parallel, :exeflags),Tuple{Bool,Cmd,Int64,Cmd}}}, ::typeof(addprocs), ::Distributed.SSHManager) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Distributed/src/cluster.jl:441
 [6] #addprocs at ./none:0 [inlined]
 [7] #addprocs#243 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Distributed/src/managers.jl:118 [inlined]
 [8] (::Distributed.var"#kw##addprocs")(::NamedTuple{(:exeflags,),Tuple{Cmd}}, ::typeof(addprocs), ::Array{Tuple{String,Int64},1}) at ./none:0
 [9] top-level scope at REPL[2]:1

I see you received no responses.

I have exactly your problem. (almost). I am trying to addproc from Ubuntu1 to Ubuntu2. Ubuntu1 is local on VBox and Ubuntu2 is remote on Azure.

Were you ever able to solve your problem? If so, can you share your solution?

Later on, I had also to use tunnel=true on the same machine.

cmd = `docker restart test_sshd`; run(cmd);

cmd_sshd = `docker inspect -f '{{ .NetworkSettings.IPAddress }}' test_sshd`; ip_sshd = read(cmd_sshd, String)

addprocs([("rob@" * ip_sshd, 1)]; exeflags=`--project=$(Base.active_project())`, tunnel=true, dir="/home/rob")