Accessing SSH keys within

The documentation here: https://circleci.com/docs/2.0/add-ssh-key/ on adding SSH keys is really not sufficient.

When I add an SSH key in this method, how can I access it within the container? My usecase is the following:

I have a multistage dockerfile which builds a container. The builder requires access to a private repo, so a private SSH key is required as a build argument.

It appears that the SSH key added to the circleci build container is not in ~/.ssh, as you would expect, so is it set as an environment variable? If so, what is the label for this environment variable?

For this specific use case, I would suggest adding a user key. You can do this from the project settings page:

https://circleci.com/gh/$ORG/$REPO/edit#checkout

Thanks Levlaz, that’s helpful.

However it still leaves an open question: What is the environment variable label, or the location of the key within the circleci root container?

I need to actually pass the key as a build-arg when I build using a dockerfile.

Looking for the answer also. How/where is the ssh key? I’m running a fabric script and need to do “fab mycommand(path to ssh key)”

I have same issue with you and I found the location which store all information. Please check .circleci-runner-config.json at root