docker / docker/docker-py

Docker server x not found in known_hosts

Open
#3,062 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.2k
Forks
1.7k
Avg merge
13d 8h
Merged PRs (30d)
2

Description

Hello.

Is there a way to add a server to known hosts using docker api?

        connection = docker.APIClient(
            base_url=f"ssh://{user}@{host}")
        data = {
            "name": server_name,
            "connection": connection
        }
        self.connections.append(data)
paramiko.ssh_exception.SSHException: Server 'x' not found in known_hosts

Because the server I am trying to create a docker api client with is new, it is not in my known_hosts. I was wondering if its possible to add it to the known hosts inside of docker api? Because the api client automatically tries to login to the ssh connection when you make the instance of the class, meaning I am not able to access the paramiko client to add the host to known hosts.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue mentions Docker APIClient, an SSH base_url, and Paramiko's known_hosts handling, but names no repository files or tests. Start by locating the APIClient SSH connection setup and checking how Paramiko loads known_hosts. Done should be defined as a documented, tested way to handle a new server's host key through the Docker client.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.