Tag: github

为什么暴露known_hosts危险

我一直在寻找使用GIT和docker进行自动化构build。 我觉得有用的工具之一是ssh-keyscan ,它将结果添加到known_hosts并允许您在首次克隆存储库时绕过“指纹”提示。 我读了一个评论说, 暴露这个文件是非常危险的 。 我以为keyscan只是把一堆公钥添加到你的known_hosts文件中。 如果有人看到这个,为什么这么危险?他们能否使用相同的工具获得完全相同的公钥? 我会想,在链接中,添加一个私人的ssh密钥到docker集装箱将是危险的部分,因为这是你不想分享的部分。

标记Docker Hub版本的最佳实践是什么?

我有一个运行应用程序的Docker Hub容器。 通常它会通过克隆源git repo来运行应用程序,但是如果我想运行特定的版本,应用程序已经标记了各种版本。 比如我可以做一个 git clone https://github.com/author/application.git git checkout release-1.0.0 作为Docker Hub维护者,我想用容器镜像软件的版本。 除了手动发布发布之外,还有其他的select吗? 现在我的Dockerfile包含这样的东西: ENV APP_VER=2.0.0 RUN git clone …; git checkout ${APP_VER} 在这个例子中,我会保留一个docker文件的标记分支,将APP_VER设置为2.1.0,然后Docker Hub支持这个,但是如果我对repo进行了更改,我不清楚该如何更改Dockerfile的每个分支。

golang docker私人github存储库

我正在尝试创build一个从私人和公共github存储库中提取的docker镜像。 我使用的dockerfile是 FROM golang:1.4.2-onbuild ENV GOPATH /go ENV PATH /go/bin:$PATH EXPOSE 3000 RUN mkdir -p /go/src/github.com/eddi/api RUN git clone https://<access token>@github.com/owner/repo.git /go/src/github.com/owner/repo WORKDIR /go/src/github.com/eddi/api RUN go get github.com/gin-gonic/gin RUN go run server.go 但是当我运行docker构build。 我得到以下错误: cd。 git clone https://github.com/gin-gonic/gin/go/src/github.com/gin-gonic/gin 克隆到“/go/src/github.com/gin-gonic/gin”… 致命:无法访问' https://github.com/gin-gonic/gin/ ':无法parsinghost:github.com 为私人和公共存储库。 如何让我的dockerfile在导入库方面performance良好?

Docker:从一个私人的GitHub仓库获取

我试图运行一个容器,将暴露一个包,我有一个私人的GitHub回购一个golang服务。 由于我正在使用GCE,我的初始图像是谷歌/ debian:wheezy。 安装所有必需的依赖和工具后,我正在运行 RUN go get github.com/<my_org>/<my_package> 该包是私人回购。 我已经添加了我的GitHub SSH密钥,以允许从私人回购克隆到泊坞窗文件: ADD priv/id_rsa /root/.ssh/id_rsa ADD priv/id_rsa.pub /root/.ssh/id_rsa.pub 不过,在尝试克隆repo时,在获取过程中出现错误: # cd .; git clone https://github.com/<my_org>/<my_package> /gopath/src/github.com/<my_org>/<my_package> Cloning into '/gopath/src/github.com/<my_org>/<my_package>'… fatal: could not read Username for 'https://github.com': No such device or address package github.com/<my_org>/<my_package>: exit status 128 为了debugging这个问题,从Dockerfile中运行: RUN ssh-keyscan -t rsa github.com 2>&1 >> /root/.ssh/known_hosts 这告诉我有一些问题。 […]

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

我正在使用这个命令使用gitbuild立一个sudo docker build github.com/roseperrone/myproject : sudo docker build github.com/roseperrone/myproject ,但是我得到这个错误: could not read Username for 'https://github.com': No such device or address 我应该如何提供我的git证书? 我正在运行一个AWS ec2实例。