我已经在我的 docker 文件中添加了 git 克隆.映像已成功生成



但无法在映像中找到我克隆的源代码.on本地机器克隆是工作,但不适用于DockerConatiner。 运行 git clone https://h..../public.git

成功构建映像 ID

从 乌班图

维护者卢克克鲁克斯"luke@pumalo.org">

运行 apt-get 更新

RUN apt-getinstall -y apache2 && apt-get clean

RUN apt-get install -y git

RUN mkdir/root/.ssh/

运行触摸/root/.ssh/id_rsa

公开 8080/TCP

运行触摸/root/.ssh/known_hosts

运行 ssh-keyscan -T 60 bitbucket.org>>/root/.ssh/known_hosts

运行 git clone -b newbr https://haseeb@bitbucket.org/haseeb/public.git

WORKDIR/var/lib/docker/overlay2/work

尝试更新 docker 文件,如下面的代码片段并重新构建

FROM ubuntu
MAINTAINER Luke Crooks "luke@pumalo.org"
RUN apt-get update
RUN apt-get install -y apache2 && apt-get clean
RUN apt-get install -y git
RUN mkdir /root/.ssh/
RUN touch /root/.ssh/id_rsa
EXPOSE 8080/tcp
RUN touch /root/.ssh/known_hosts
RUN ssh-keyscan -T 60 bitbucket.org >> /root/.ssh/known_hosts
RUN makdir -p /var/lib/docker/overlay2/work
WORKDIR /var/lib/docker/overlay2/work
RUN git clone -b newbr https://haseeb@bitbucket.org/haseeb/public.git

克隆的存储库应处于/var/lib/docker/overlay2/work

最新更新