Configure the sentry context on the Pi

You now need to be able to control the droplet’s root user from the Raspberry Pi’s pi user. Create a new SSH config entry for the sentry (replace sentry.example.com with your own droplet’s DNS name):

Append to the SSH config on the Pi

Run this on the Raspberry Pi
cat <<EOF >> ~/.ssh/config
Host sentry
    User root
    Hostname sentry.example.com
    ControlMaster auto
    ControlPersist yes
    ControlPath /tmp/ssh-%u-%r@%h:%p
EOF
Tip

The Hostname value should point to the same name you created the DNS entry for the sentry.

Test the connection from the Pi to the sentry

Run this on the Raspberry Pi
ssh sentry whoami

The first time you connect, you must confirm the host fingerprint (type yes):

(stdout)
The authenticity of host 'sentry' can't be established.
ED25519 key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes

On the final line, it will print the output of the command you requested, which should print the username root :

(stdout)
root

Create a new Docker context for the sentry

Run this on the Raspberry Pi
d context new
(stdout)
? This command can help create a new SSH config and Docker context. Proceed? (Y/n) y

? You must specify the SSH config entry to use
> I already have an SSH host entry in ~/.ssh/config that I want to use
  I want to make a new SSH host entry in ~/.ssh/config

? Choose an existing SSH Host config
  pi
> sentry

> Do you want to switch to the new sentry context now? Yes

Install Docker on the sentry

Run this on the Raspberry Pi
sentry install-docker
(stdout)
? This will install Docker on the host of your remote Docker context.. Proceed? Yes

Test the docker context is functional

Run this on the Raspberry Pi
d tmp-context sentry docker info | grep Context
(stdout)
Context:    sentry
Switch between Docker contexts

You should now have two configured Docker contexts on your Pi:

  • pi
  • sentry

You can switch between these two contexts using d context. The currently selected context specifies which Docker server is currently being operated on.