这里是泊坞窗的git命令泊坞窗混帐克隆不克隆(而不是示数)
WORKDIR /var/www
RUN git clone --verbose [email protected]:<private git repo>.git /var/www
的混帐克隆命令执行没有错误,但附着在容器后,我找不到项目任何文件夹。我已经尝试在克隆之前将光盘放入/ var/www中,但结果相同。奇怪的是,我预计--verbose标志会输出项目的摘要细节,但它不会。因此,我增加验证ssh连接声明:
RUN \
chmod 600 /repo-key && \
echo "IdentityFile /repo-key" >> /etc/ssh/ssh_config && \
echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config && \
ssh -v [email protected]
连接成功,输出:
Hi willlopez! You've successfully authenticated, but GitHub does not provide shell access.
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
debug1: fd 2 clearing O_NONBLOCK
Transferred: sent 2944, received 1464 bytes, in 0.1 seconds
Bytes per second: sent 31103.1, received 15467.0
debug1: Exit status 1
的混帐克隆输出:
Cloning into '/var/www'...
Warning: Permanently added the RSA host key for IP address to the list of known hosts.
我用nsenter泊坞窗进入附加到正在运行的容器。/var/www为空
是/ var/www声明为一个卷? –
@AdrianMouat是的,它是 –
它需要是一个“工作”目录,以便开发人员可以对项目进行更改,验证更改并将其检入git –