I was very impressed by Anca’s demonstration of using docker contexts at DockerConnect 2020. Now I am trying to get this going on my own system and trying to bring up containers on AWS Lightsail where I have a Docker instance created. I am running docker 19.03 on Lightsail.
I have created context called remote:
richb201@richb201-XPS-13-9370:~$ docker context create remote --docker “host=ssh://ubuntu@54.152.94.40”
context “remote” already exists
next I try to switch to it but I get this error:
richb201@richb201-XPS-13-9370:~$ docker --context remote ps
error during connect: Get http://docker/v1.40/containers/json: command [ssh -l ubuntu 54.152.94.40 – docker system dial-stdio] has exited with exit status 255, please make sure the URL is valid, and Docker 18.09 or later is installed on the remote host: stderr=ubuntu@54.152.94.40: Permission denied (publickey).
To show that my public key works, I can directly ssh to the container:
richb201@richb201-XPS-13-9370:~$ ssh -i /home/richb201/Downloads/Docker1KeyPair.pem ubuntu@54.152.94.40
Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 5.3.0-1019-aws x86_64)
- Documentation: https://help.ubuntu.com
- Management: https://landscape.canonical.com
- Support: https://ubuntu.com/advantage
System information as of Fri Jun 5 09:47:08 UTC 2020
System load: 0.0 Users logged in: 0
Usage of /: 15.3% of 19.32GB IP address for eth0: 172.26.15.76
Memory usage: 71% IP address for docker0: 172.17.0.1
Swap usage: 0% IP address for br-1ce9162cc37b: 172.18.0.1
Processes: 102
-
MicroK8s gets a native Windows installer and command-line integration.
https://ubuntu.com/blog/microk8s-installers-windows-and-macos
Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud
- Canonical Livepatch is available for installation.
- Reduce system reboots and improve kernel security. Activate at:
https://ubuntu.com/livepatch
- Reduce system reboots and improve kernel security. Activate at:
124 packages can be updated.
0 updates are security updates.
Last login: Fri Jun 5 09:35:10 2020 from 69.124.177.46
To run a command as administrator (user “root”), use "sudo ".
See “man sudo_root” for details.
BTW, I am concerned that memory usage is 71% and i haven;t even brought up my containers yet. I do see some containers already running in my instance that I don’t remember loading myself. Any idea what these are and how I get rid of them? I can’t docker-compose down since I don’t have the docker-compose.yml. Do I need them?
ubuntu@ip-172-26-15-76:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5be2aab0db39 mikegcoleman/todo:latest “node ./bin/www” 40 hours ago Up 40 hours 0.0.0.0:80->3000/tcp docker_front_end_1
6d4bba3453bc mongo:latest “docker-entrypoint.s…” 40 hours ago Up 40 hours 27017/tcp docker_db_1