

Permission granted! $ docker run -it -rm -e "USER_ID=$(id -u)" -e GROUP_ID="$(id -g)" \ Please make sure you have the correct access rightsĪs the container has neither access to the ssh keys nor to the known-hosts files, cloning fails. Warning: Permanently added ',140.82.121.4' (ECDSA) to the list of known Permission denied (publickey).įatal: Could not read from remote repository. The authenticity of host ' (140.82.121.4)' can't be established.ĮCDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM.Īre you sure you want to continue connecting (yes/no/)? yes We run the container and clone the same private repository as above $ docker run -it -rm -e "USER_ID=$(id -u)" -e GROUP_ID="$(id -g)" \ĭocker-private-repos:0.1 git clone into 'foss-compliance'. The container provides a basic Ubuntu 20.04 system with git. We build the container with the command $ docker build -tag docker-private-repos:0.1. After cloning the repository, we change to the directory embeddeduse/BlogPosts/docker-private-repos. I have prepared an example Docker container in my repository embeddeduse. Once we can clone the private repository from the host computer, we are ready to try the same from a Docker container.
Smartgit ssh how to#
The article Understanding SSH known_hosts File with Examples gives tips how to analyse and fix problems with ssh keys. From then on, accessing the private repository works without interaction. Git-clone adds the fingerprint to $HOME/.ssh/known_hosts. $ git clone we clone a repository from the server for the very first time, git-clone will ask us whether we want to add the key fingerprint (that is, the public key) of the server to the list of known hosts.

Of course, you will have to use one of your private repositories. My example private repository is foss-compliance.git. We ensure that we can access the private git repository from the host computer, on which we will run the Docker container.
Smartgit ssh update#
Hence, we must be able to clone and update private repositories from the container. We typically use a Docker container to build the whole embedded Linux system with Yocto. Quite a few SoM and terminal makers do the same with their Yocto layers and their additional software. We keep the source code of our applications and libraries in private repositories.
