I am trying to run bower installinside a docker container passed as a command indocker-compose.yml
Relevant code in docker-compose.yml:
services:
assets:
build: ./src
command: >
sh -c '
bower install --allow-root;
'
bower.json has the following dependency:
{
"name": "projectname",
"version": "version",
"dependencies": {
"remote-repo": "ssh://git@remoterepo.url/repo.git#branch"
}
}
This remote repo is closed. The host machine has the correct SSH credentials to pull from this remote.
I tried passing SSH credentials from my host machine to the docker container 4 or 5 in various ways, but each attempt gives me the same error message:
docker_1 | bower repo
ls-remote --tags --heads ssh://git@remoterepo.url/repo.git", exit code
of
remote repository. Please make sure you have the correct access
rights and the repository exists.
exec git, , , known_hosts, ssh ( ).
stackoverflow, : qaru.site/questions/37136/...
, ssh, , Docker RUN: https://serverfault.com/questions/132970/can-i-automatically-add-a-new-host-to-known-hosts/316100#316100
, script ( docker-compose up, ) :
cp $HOME/.ssh/id_rsa src/id_rsa
, id_rsa , Docker ( , src )
Dockerfile :
RUN mkdir /root/.ssh/
ADD id_rsa /root/.ssh/id_rsa
RUN touch /root/.ssh/known_hosts
RUN ssh-keygen -R remoterepo.url
RUN ssh-keygen -R remoterepoIP
RUN ssh-keygen -R remoterepo.url,remoterepoIP
RUN ssh-keyscan -H remoterepo.url,remoterepoIP >> /root/.ssh/known_hosts
RUN ssh-keyscan -H remoterepoIP >> /root/.ssh/known_hosts
RUN ssh-keyscan -H remoterepo.url >> /root/.ssh/known_hosts
? , ( ).