0

I am building dockerfile to create an image where I want to build a package. I want to pull this package inside the docker image. I need to do a git clone for that. I saw the discussion on this post :

Using SSH keys inside docker container

Based on that, here is the content in my Dockerfile : ENV SSH_HOME /Users/myid ADD $SSH_HOME/.ssh/id_rsa /root/.ssh/id_rsa RUN echo " IdentityFile ~/.ssh/id_rsa" >> /etc/ssh/ssh_config

When I run docker build, I am getting an error due to relative path. If I provide absolute path, it says the location is outside of context. Any idea how to fix this? I am running on Mac OSX 10.

With the script above, I am getting the following error : ADD failed: stat /var/lib/docker/tmp/docker-builder6164655/Users/myid/.ssh/id_rsa: no such file or directory

Santanu C
  • 1,362
  • 3
  • 20
  • 38

1 Answers1

1

Looks like it might be related to this bug here

The broken example is very similar to your path problem:

# Dockerfile
FROM ubuntu:14.04
COPY start.sh /start.sh

# comes back with: 
stat /var/lib/docker/aufs/mnt/e89417ccaafbc91c3f930b56819427f83b3f2d3b3a246fbd6b48c9abcc7233f6/start.sh: no such file or directory

I'd try

  • updating to the most recent docker
  • restarting your docker engine
viraj_os
  • 738
  • 1
  • 5
  • 11