0

I have a pipeline in butbucket with a runner with docker install on a VPS. When I run the pipeline it fails in the line “git pull origin master”.

I set SSH keys in SSH keys menu on bitbucket I’ve added the file authorized_keys on VPS and it gives this error.

Host bitbucket.org

UseKeychain yes

IdentityFile ~/.ssh/jga

Error as follows:

Load key "/home/debian/apps/test/1401a1c6-b767-5d08-8df5-6edc1e68ccdb/ssh/id_rsa": invalid format

git@bitbucket.org: Permission denied (publickey).

It seems as if I have to configure something inside the docker (runner). I don’t know!

Any ideas?

the runner:

docker container run -it -v /home/debian/apps/test:/home/debian/apps/test -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/containers:/var/lib/docker/containers:ro -e ACCOUNT_UUID={ccc2-3cf0-4d66-a66e-14b9b7a6} -e REPOSITORY_UUID={62e5f-c708-4bce-a251-51177bf} -e RUNNER_UUID={1401-b767-5d08-8df5-6edc1e68cdb} -e RUNTIME_PREREQUISITES_ENABLED=true -e OAUTH_CLIENT_ID=2PulGVaC61dTCHkHZ -e OAUTH_CLIENT_SECRET=0CCKQK8dvaWwL7_n2PoOR1c4zqo -e WORKING_DIRECTORY=/home/debian/apps/test --name runner-1401a1c6-b767-5d08-8df5-6edc1e68ccdb docker-public.packages.atlassian.com/sox/atlassian/bitbucket-pipelines-runner:1
rpjs
  • 169
  • 13
  • What are your permissions on your key? I've seen this when it isn't `chmod 0600`, when attempting to authenticate via SSH. – JJ Asghar Apr 21 '22 at 14:58
  • My permissions are 0600 on private and private key (jga, jga.pub) – rpjs Apr 21 '22 at 15:17
  • Are they being copy'd into the container with those permissions? Don't forget containers run as root by default, not your user. – JJ Asghar Apr 21 '22 at 15:35
  • No, there are not inside the container, How can I do it?, I add the runner in the questions? – rpjs Apr 21 '22 at 15:45
  • Can you post the `Dockerfile`? You probably want to add a `chmod 0600` after the copy into the container, before the `git clone`. – JJ Asghar Apr 21 '22 at 17:08
  • I'm confused, I juts have the runner, I don't have a dockerfile. Bitbucket gave me the runner to be run inside the VPS. Should I create a more container wih a dockerfile, and in that case, do i have to use both, the docker runner and the new container?, how? – rpjs Apr 22 '22 at 09:29
  • Oh, I thought you were creating the docker container and then running it. the `docker` command threw me off. This feels like something you reach out to Atlassian and ask them. – JJ Asghar Apr 22 '22 at 13:10

0 Answers0