我有一個應用程序可以使用Git執行各種有趣的操作(例如運行git clone和git push),而我正在嘗試對其進行docker-ize。我遇到了一個問題,盡管我需要能夠向容器中添加SSH密鑰以供容器“用戶”使用。我嘗試將其復制到/root/.ssh/,進行更改$HOME,創建了一個git ssh包裝器,但還是沒有運氣。這是Dockerfile供參考:#DOCKER-VERSION 0.3.4 from ubuntu:12.04 RUN apt-get update RUN apt-get install python-software-properties python g++ make git-core openssh-server -yRUN add-apt-repository ppa:chris-lea/node.js RUN echo "deb http://archive.ubuntu.com/ubuntu precise universe" >> /etc/apt/sources.listRUN apt-get update RUN apt-get install nodejs -y ADD . /src ADD ../../home/ubuntu/.ssh/id_rsa /root/.ssh/id_rsa RUN cd /src; npm install EXPOSE 808:808 CMD [ "node", "/src/app.js"]app.js 運行git命令,如 git pull
添加回答
舉報
0/150
提交
取消