Dockerfile cloning from private gitlab with ssh and deploy keyNon interactive git clone (ssh fingerprint prompt)Local SSH connection to Gitlab not workingGitlab not working with SSH KeysGitLab - Does not accept pushes via SSH [asks for SSH password], works with HTTP?Gitlab omnibus fails to add ssh keyCannot clone private repositroy from the docker containerCannot push to gitlab with ssh through a jump hostAnsible versioning on gitAnsible Playbook running locally but unable to ssh to host via AWXGit clone from Gitlab incredibly slow in Docker container
Leading and Suffering Numbers
What is the most important source of natural gas? coal, oil or other?
Question about exercise 11.5 in TeXbook
SQL Server (JOIN) all from first with NULLs from 2nd
Plot exactly N bounce of a ball
What's the connection between "kicking a pigeon" and "how a bill becomes a law"?
How do I remove these transparent pixels?
Employer demanding to see degree after poor code review
How does apt-get works (in details)?
Do you play the upbeat when beginning to play a series of notes, and then after?
How were these pictures of spacecraft wind tunnel testing taken?
How to properly maintain eye contact with people that have distinct facial features?
Inverter Power draw from 12V battery
What is the 中 in ダウンロード中?
Is floating in space similar to falling under gravity?
shutdown at specific date
Pattern matching repeated arguments of Times
Yandex Programming Contest: Alarms
Apparent Ring of Craters on the Moon
Is this story about US tax office reasonable?
Is it possible to change original filename of an exe?
Can a wire having a 610-670 THz (frequency of blue light) AC frequency supply, generate blue light?
Ticket sales for Queen at the Live Aid
I think I may have violated academic integrity last year - what should I do?
Dockerfile cloning from private gitlab with ssh and deploy key
Non interactive git clone (ssh fingerprint prompt)Local SSH connection to Gitlab not workingGitlab not working with SSH KeysGitLab - Does not accept pushes via SSH [asks for SSH password], works with HTTP?Gitlab omnibus fails to add ssh keyCannot clone private repositroy from the docker containerCannot push to gitlab with ssh through a jump hostAnsible versioning on gitAnsible Playbook running locally but unable to ssh to host via AWXGit clone from Gitlab incredibly slow in Docker container
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
(EDIT) This problem was happening also from my laptop using root and my user, which could get the greeting when trying to ssh with git user. Then tried the ansible playbook and it raised errors for the repo too. Tried another one and that clones flawlessly. The problem, then, doesn't seem to be with git, docker or ssh, but with the gitlab configuration.
On a Dockerfile I am trying to clone private repositories hosted on a company server running gitlab and setup with a non standard ssh port.
This is what I expected to run (alongside with some params in ssh config file)
RUN git clone git@companyname.ddns.net:GroupName/repo_name.git
Things I've checked already:
- The repo has a deploy key and it is active.
- Automating with Ansible instead of docker, it can connect and clone repos.
- The key is named id_rsa and it is inside ~/.ssh/
Tried with ssh-agent and seems ok (though I specify the file in the config and shouldn't need it)
Identity added: /opt/.ssh/id_rsa (/opt/.ssh/id_rsa)The ~/.ssh/config has the following:
Host *
StrictHostKeyChecking no
PubkeyAcceptedKeyTypes +ssh-rsa
PasswordAuthentication no
User git
ForwardAgent yes
Identityfile /opt/.ssh/id_rsa # /opt is the home of the user RUNning the command in docker
port 22022
RUNning this from the container:
ssh -vT -i /opt/.ssh/id_rsa git@companyname.ddns.net:GroupName/repo_name.git
Gets the result
Welcome to GitLab, Anonymous!
But the git clone command gets:
Cloning into 'repo_name'...
GitLab: The project you were looking for could not be found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The command '/bin/sh -c git clone git@companyname.ddns.net:GroupName/repo_name.git;' returned a non-zero code: 128
ssh docker git gitlab
add a comment |
(EDIT) This problem was happening also from my laptop using root and my user, which could get the greeting when trying to ssh with git user. Then tried the ansible playbook and it raised errors for the repo too. Tried another one and that clones flawlessly. The problem, then, doesn't seem to be with git, docker or ssh, but with the gitlab configuration.
On a Dockerfile I am trying to clone private repositories hosted on a company server running gitlab and setup with a non standard ssh port.
This is what I expected to run (alongside with some params in ssh config file)
RUN git clone git@companyname.ddns.net:GroupName/repo_name.git
Things I've checked already:
- The repo has a deploy key and it is active.
- Automating with Ansible instead of docker, it can connect and clone repos.
- The key is named id_rsa and it is inside ~/.ssh/
Tried with ssh-agent and seems ok (though I specify the file in the config and shouldn't need it)
Identity added: /opt/.ssh/id_rsa (/opt/.ssh/id_rsa)The ~/.ssh/config has the following:
Host *
StrictHostKeyChecking no
PubkeyAcceptedKeyTypes +ssh-rsa
PasswordAuthentication no
User git
ForwardAgent yes
Identityfile /opt/.ssh/id_rsa # /opt is the home of the user RUNning the command in docker
port 22022
RUNning this from the container:
ssh -vT -i /opt/.ssh/id_rsa git@companyname.ddns.net:GroupName/repo_name.git
Gets the result
Welcome to GitLab, Anonymous!
But the git clone command gets:
Cloning into 'repo_name'...
GitLab: The project you were looking for could not be found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The command '/bin/sh -c git clone git@companyname.ddns.net:GroupName/repo_name.git;' returned a non-zero code: 128
ssh docker git gitlab
add a comment |
(EDIT) This problem was happening also from my laptop using root and my user, which could get the greeting when trying to ssh with git user. Then tried the ansible playbook and it raised errors for the repo too. Tried another one and that clones flawlessly. The problem, then, doesn't seem to be with git, docker or ssh, but with the gitlab configuration.
On a Dockerfile I am trying to clone private repositories hosted on a company server running gitlab and setup with a non standard ssh port.
This is what I expected to run (alongside with some params in ssh config file)
RUN git clone git@companyname.ddns.net:GroupName/repo_name.git
Things I've checked already:
- The repo has a deploy key and it is active.
- Automating with Ansible instead of docker, it can connect and clone repos.
- The key is named id_rsa and it is inside ~/.ssh/
Tried with ssh-agent and seems ok (though I specify the file in the config and shouldn't need it)
Identity added: /opt/.ssh/id_rsa (/opt/.ssh/id_rsa)The ~/.ssh/config has the following:
Host *
StrictHostKeyChecking no
PubkeyAcceptedKeyTypes +ssh-rsa
PasswordAuthentication no
User git
ForwardAgent yes
Identityfile /opt/.ssh/id_rsa # /opt is the home of the user RUNning the command in docker
port 22022
RUNning this from the container:
ssh -vT -i /opt/.ssh/id_rsa git@companyname.ddns.net:GroupName/repo_name.git
Gets the result
Welcome to GitLab, Anonymous!
But the git clone command gets:
Cloning into 'repo_name'...
GitLab: The project you were looking for could not be found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The command '/bin/sh -c git clone git@companyname.ddns.net:GroupName/repo_name.git;' returned a non-zero code: 128
ssh docker git gitlab
(EDIT) This problem was happening also from my laptop using root and my user, which could get the greeting when trying to ssh with git user. Then tried the ansible playbook and it raised errors for the repo too. Tried another one and that clones flawlessly. The problem, then, doesn't seem to be with git, docker or ssh, but with the gitlab configuration.
On a Dockerfile I am trying to clone private repositories hosted on a company server running gitlab and setup with a non standard ssh port.
This is what I expected to run (alongside with some params in ssh config file)
RUN git clone git@companyname.ddns.net:GroupName/repo_name.git
Things I've checked already:
- The repo has a deploy key and it is active.
- Automating with Ansible instead of docker, it can connect and clone repos.
- The key is named id_rsa and it is inside ~/.ssh/
Tried with ssh-agent and seems ok (though I specify the file in the config and shouldn't need it)
Identity added: /opt/.ssh/id_rsa (/opt/.ssh/id_rsa)The ~/.ssh/config has the following:
Host *
StrictHostKeyChecking no
PubkeyAcceptedKeyTypes +ssh-rsa
PasswordAuthentication no
User git
ForwardAgent yes
Identityfile /opt/.ssh/id_rsa # /opt is the home of the user RUNning the command in docker
port 22022
RUNning this from the container:
ssh -vT -i /opt/.ssh/id_rsa git@companyname.ddns.net:GroupName/repo_name.git
Gets the result
Welcome to GitLab, Anonymous!
But the git clone command gets:
Cloning into 'repo_name'...
GitLab: The project you were looking for could not be found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The command '/bin/sh -c git clone git@companyname.ddns.net:GroupName/repo_name.git;' returned a non-zero code: 128
ssh docker git gitlab
ssh docker git gitlab
edited Oct 5 '17 at 16:30
Rubén Cabrera
asked Oct 4 '17 at 16:04
Rubén CabreraRubén Cabrera
1369
1369
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Where is ~/.ssh/config ? Docker builds are done as root so that config would need to be in /root/.ssh/config
It is in /opt/.ssh/config . /opt being the home of the user I expect to run the git clone, after USER user_name. Ownership is explicitly changed and so are permissions, set to 400
– Rubén Cabrera
Oct 4 '17 at 17:16
Hoping this was the problem, added the config file to both /opt/.ssh and /root/.ssh. The problem remains the same, sadly.
– Rubén Cabrera
Oct 5 '17 at 14:31
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f876878%2fdockerfile-cloning-from-private-gitlab-with-ssh-and-deploy-key%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Where is ~/.ssh/config ? Docker builds are done as root so that config would need to be in /root/.ssh/config
It is in /opt/.ssh/config . /opt being the home of the user I expect to run the git clone, after USER user_name. Ownership is explicitly changed and so are permissions, set to 400
– Rubén Cabrera
Oct 4 '17 at 17:16
Hoping this was the problem, added the config file to both /opt/.ssh and /root/.ssh. The problem remains the same, sadly.
– Rubén Cabrera
Oct 5 '17 at 14:31
add a comment |
Where is ~/.ssh/config ? Docker builds are done as root so that config would need to be in /root/.ssh/config
It is in /opt/.ssh/config . /opt being the home of the user I expect to run the git clone, after USER user_name. Ownership is explicitly changed and so are permissions, set to 400
– Rubén Cabrera
Oct 4 '17 at 17:16
Hoping this was the problem, added the config file to both /opt/.ssh and /root/.ssh. The problem remains the same, sadly.
– Rubén Cabrera
Oct 5 '17 at 14:31
add a comment |
Where is ~/.ssh/config ? Docker builds are done as root so that config would need to be in /root/.ssh/config
Where is ~/.ssh/config ? Docker builds are done as root so that config would need to be in /root/.ssh/config
answered Oct 4 '17 at 17:12
MikeMike
18.9k44270
18.9k44270
It is in /opt/.ssh/config . /opt being the home of the user I expect to run the git clone, after USER user_name. Ownership is explicitly changed and so are permissions, set to 400
– Rubén Cabrera
Oct 4 '17 at 17:16
Hoping this was the problem, added the config file to both /opt/.ssh and /root/.ssh. The problem remains the same, sadly.
– Rubén Cabrera
Oct 5 '17 at 14:31
add a comment |
It is in /opt/.ssh/config . /opt being the home of the user I expect to run the git clone, after USER user_name. Ownership is explicitly changed and so are permissions, set to 400
– Rubén Cabrera
Oct 4 '17 at 17:16
Hoping this was the problem, added the config file to both /opt/.ssh and /root/.ssh. The problem remains the same, sadly.
– Rubén Cabrera
Oct 5 '17 at 14:31
It is in /opt/.ssh/config . /opt being the home of the user I expect to run the git clone, after USER user_name. Ownership is explicitly changed and so are permissions, set to 400
– Rubén Cabrera
Oct 4 '17 at 17:16
It is in /opt/.ssh/config . /opt being the home of the user I expect to run the git clone, after USER user_name. Ownership is explicitly changed and so are permissions, set to 400
– Rubén Cabrera
Oct 4 '17 at 17:16
Hoping this was the problem, added the config file to both /opt/.ssh and /root/.ssh. The problem remains the same, sadly.
– Rubén Cabrera
Oct 5 '17 at 14:31
Hoping this was the problem, added the config file to both /opt/.ssh and /root/.ssh. The problem remains the same, sadly.
– Rubén Cabrera
Oct 5 '17 at 14:31
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f876878%2fdockerfile-cloning-from-private-gitlab-with-ssh-and-deploy-key%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown