我有一个应用程序,使用Git执行各种有趣的东西(如运行git clone和git push),我正在尝试停靠它.
我遇到了一个问题,虽然我需要能够在容器中添加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 -y
RUN add-apt-repository ppa:chris-lea/node.js
RUN echo "deb http://archive.ubuntu.com/ubuntu precise universe" >> /etc/apt/sources.list
RUN 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"]
Run Code Online (Sandbox Code Playgroud)
app.js 像git一样运行git命令 git pull
我已经使用github和capistrano将我的Rails 4应用程序部署到Rackspace几周了.一切正常,直到我最终使我的存储库私有化.现在,我在运行'cap deploy'后收到以下错误:
"致命:无法读取' https://username@github.com '的密码:没有这样的设备或地址"
以下是我的deploy.rb文件中的代码
set :application, "appname"
set :repository, "https://git_username@github.com/git_username/appname.git"
set :scm, :git
set :scm_username, "git_username"
set :scm_passphrase, "git_password"
set :scm_command, "git"
set :keep_releases, 5
set :branch, "master"
set :rails_env, "production"
set :deploy_to, "/var/www/doLocal"
set :user, "deployer"
set :password, "deployer_password"
set :use_sudo, false
ssh_options[:forward_agent] = true
server "/path/to/server", :app, :web, :db, :primary => true
after "deploy:restart", "deploy:cleanup"
namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => …Run Code Online (Sandbox Code Playgroud)