相关疑难解决方法(0)

无法打开与身份验证代理的连接

我遇到了这个错误:

$ git push heroku master
Warning: Permanently added the RSA host key for IP address '50.19.85.132' to the list of known hosts.
!  Your key with fingerprint b7:fd:15:25:02:8e:5f:06:4f:1c:af:f3:f0:c3:c2:65 is not authorized to access bitstarter.
Run Code Online (Sandbox Code Playgroud)

我试图添加密钥,我在下面收到此错误:

$ ssh-add ~/.ssh/id_rsa.pub
Could not open a connection to your authentication agent.
Run Code Online (Sandbox Code Playgroud)

ssh ssh-agent

1473
推荐指数
29
解决办法
114万
查看次数

使用dockerfile克隆私有git repo

我已经复制了这个代码,似乎是各种工作的dockerfiles,这是我的:

FROM ubuntu

MAINTAINER Luke Crooks "luke@pumalo.org"

# Update aptitude with new repo
RUN apt-get update

# Install software 
RUN apt-get install -y git python-virtualenv

# Make ssh dir
RUN mkdir /root/.ssh/

# Copy over private key, and set permissions
ADD id_rsa /root/.ssh/id_rsa
RUN chmod 700 /root/.ssh/id_rsa
RUN chown -R root:root /root/.ssh

# Create known_hosts
RUN touch /root/.ssh/known_hosts

# Remove host checking
RUN echo "Host bitbucket.org\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config

# Clone the conf files into the docker container
RUN git …
Run Code Online (Sandbox Code Playgroud)

git bitbucket docker

219
推荐指数
7
解决办法
17万
查看次数

npm在package.json中依赖安装私有github存储库

我正在尝试通过npm安装github私有存储库,其中包含其他私有github存储库作为依赖项.

尝试了很多方法和帖子,但没有一个工作.这是我正在做的事情:

npm install git+https://github.com/myusername/mygitrepository.git
Run Code Online (Sandbox Code Playgroud)

在package.json中就像:

"dependencies": {
    "repository1name": "git+https://github.com/myusername/repository1.git",
    "repository2name": "git+https://github.com/myusername/repository2.git"
}
Run Code Online (Sandbox Code Playgroud)

这样做的正确方法是什么?

dependencies github node.js npm package.json

192
推荐指数
8
解决办法
16万
查看次数

使用带有docker的ssh-agent

我想使用ssh-agent将我的密钥转发到docker镜像并从私有github仓库中取出.

我在Yosemite上使用了一个稍微修改过的https://github.com/phusion/passenger-docker和boot2docker.

ssh-add -l
...key details
boot2docker up
Run Code Online (Sandbox Code Playgroud)

然后我使用我在很多地方看到的命令(即https://gist.github.com/d11wtq/8699521):

docker run --rm -t -i -v $SSH_AUTH_SOCK:/ssh-agent -e SSH_AUTH_SOCK=/ssh-agent my_image /bin/bash
Run Code Online (Sandbox Code Playgroud)

但它似乎不起作用:

root@299212f6fee3:/# ssh-add -l
Could not open a connection to your authentication agent.

root@299212f6fee3:/# eval `ssh-agent -s`
Agent pid 19

root@299212f6fee3:/# ssh-add -l
The agent has no identities.

root@299212f6fee3:/# ssh git@github.com
Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts.
Permission denied (publickey).
Run Code Online (Sandbox Code Playgroud)

macos ssh docker boot2docker

24
推荐指数
3
解决办法
1万
查看次数

使用Docker Compose将主机的SSH密钥注入Docker Machine

我在Mac OS X上使用Docker与Docker Machine(使用默认的boot2docker机器),我使用docker-compose来设置我的开发环境.

假设其中一个容器名为" stack".现在我想做的是打电话:

docker-composer run stack ssh user@stackoverflow.com
Run Code Online (Sandbox Code Playgroud)

我的公钥(已添加到stackoverflow.com用于验证我的公钥)位于主机上.我希望这个密钥可以在Docker Machine容器中使用,这样我就能够stackoverflow在容器内使用该密钥进行身份验证.最好不要将我的密钥物理复制到Docker Machine.

有没有办法做到这一点?此外,如果我的密钥受密码保护,有没有办法解锁它一次,所以每次注入后我不必手动输入密码?

ssh docker docker-compose docker-machine

23
推荐指数
5
解决办法
2万
查看次数

无法读取“https://github.com”的用户名:没有这样的设备或地址

我正在使用以下命令git构建docker图像:sudo docker build github.com/roseperrone/myproject,但出现此错误:

could not read Username for 'https://github.com': No such device or address

我应该如何提供我的 git 凭据?

我在 AWS ec2 实例中运行。

git github docker

10
推荐指数
1
解决办法
2万
查看次数

Docker 加载密钥“/root/.ssh/id_rsa”:格式无效

我正在尝试克隆一个包含子模块的存储库。主 repo 克隆正常,但是当我git submodule update --init --recursive在 dockerfile 中执行时,子模块抛出并出错。

fatal: clone of 'git@github.com:jkeys089/lua-resty-hmac.git' into submodule path '/tmp/third-party/lua-resty-hmac' failed
Failed to clone 'third-party/lua-resty-hmac'. Retry scheduled
Cloning into '/tmp/third-party/lua-resty-jwt'...
load pubkey "/root/.ssh/id_rsa": invalid format
Warning: Permanently added the RSA host key for IP address '140.82.118.3' to the list of known hosts.
Load key "/root/.ssh/id_rsa": invalid format
git@github.com: Permission denied (publickey).
Run Code Online (Sandbox Code Playgroud)

在图像中我有这个

# authorise ssh host
RUN mkdir /root/.ssh/ \
    && chmod 700 /root/.ssh \
    && ssh-keyscan github.com > /root/.ssh/known_hosts

# …
Run Code Online (Sandbox Code Playgroud)

git ssh github docker dockerfile

10
推荐指数
4
解决办法
2万
查看次数

在Windows上使用Docker Compose进行卷绑定

我最近在Windows 10上升级了Docker Toolbox,现在我的卷挂载不再起作用。我已经尝试了一切。这是当前的安装路径:

volumes:
  - C:\Users\Joey\Desktop\backend:/var/www/html
Run Code Online (Sandbox Code Playgroud)

我收到无效的绑定安装错误。

windows docker docker-compose docker-machine docker-toolbox

8
推荐指数
5
解决办法
2万
查看次数

在docker文件中将私钥添加到ssh-agent

我正在尝试为angular cli项目编写一个docker文件,但我有一个外部依赖项,它是BitBucket上的私有仓库,所以我需要传递我的ssh密钥.我正在尝试使用ssh密钥--build-arg

现在的问题是,它没有将这些密钥添加到ssh-agent并要求输入密码.

我正在使用此命令运行 docker build -t ng-2-docker/client --build-arg ssh_prv_key="$(cat ~/.ssh/id_rsa)" --build-arg ssh_pub_key="$(cat ~/.ssh/id_rsa)" .

这是我的docker文件

ARG ssh_prv_key
ARG ssh_pub_key

# Use an official Node runtime as a parent image
FROM node:8.9.4

# Specify working directory in docker container
WORKDIR /app

# Authorize SSH Host
RUN mkdir -p /ssh/
RUN chmod 0700 /ssh

# Add the keys and set permissions
RUN echo "$ssh_prv_key" > /ssh/id_rsa && echo "$ssh_pub_key" > /ssh/id_rsa.pub && chmod 600 /ssh/id_rsa && chmod 600 /ssh/id_rsa.pub

# …
Run Code Online (Sandbox Code Playgroud)

git ssh docker dockerfile

7
推荐指数
3
解决办法
5033
查看次数

在docker的build阶段内使用github private repo deploy key进行npm install

我的用例是我有多个使用相同中间件的快速微服务,我想为每个中间件创建一个npm模块格式的不同repo.

每个仓库都是私人仓库,可以附加部署密钥(可以是不同的密钥或相同)

所有这些都可以在本地运行.但是当我尝试在我的docker-compose设置中使用它时,它在构建阶段的npm安装步骤失败.

Dockerfile

FROM node:alpine
RUN npm install --production
CMD npm start
Run Code Online (Sandbox Code Playgroud)

泊坞窗,compose.yml

services:
   node-api:
        build:
            context: .
            dockerfile: Dockerfile
Run Code Online (Sandbox Code Playgroud)

我知道这不起作用,因为我没有在Docker上下文中使用我的本地系统上的部署密钥.

我四处寻找解决方案,似乎没有一个非常容易/非hacky

  1. 复制密钥并压缩(缺点:不确定我是如何在docker-compose文件中执行此操作)http://blog.cloud66.com/pulling-git-into-a-docker-image-without-leaving-ssh-键隐藏/

  2. 在构建步骤中复制键并添加到图像.(缺点:不太安全:()

  3. 使用密钥作为构建参数.(缺点:见2)

  4. https://www.vaultproject.io/这样的Dockerise 首先运行它,添加密钥并在节点容器中使用它来获取最新的密钥.(缺点:可能很多工作,也许还有其他问题?)

  5. 使用Docker机密和docker堆栈部署并将密钥存储在docker机密中(CON:docker stack deploy还不支持docker卷.请参阅https://docs.docker.com/compose/bundles/#producing-a-bundle 不支持的密钥'卷')

我的问题是什么是最安全的自动化解决方案(文件用户的最小手动步骤)?实施时间不太重要.我试图避免检入任何敏感数据,同时让其他人可以轻松地在本地运行.

docker

6
推荐指数
1
解决办法
1651
查看次数