[英]Docker: Clone git repo in current directory
I am using docker to clone a public repository.我正在使用docker来克隆一个公共存储库。 It's cloned successfully.
克隆成功了。 But I don't know where its cloned?
但我不知道它的克隆在哪里? Also how can I clone the repo in my current working directory using docker?
另外,如何使用 docker 在当前工作目录中克隆 repo?
Dockerfile文件
FROM debian:stretch
RUN apt-get update
RUN apt-get install -y git
RUN git clone https://github.com/ishpreet-singh/Sudoku.git
Terminal终端
root@ubuntu:/home/hp1/Desktop/src/sample# docker build -t img2 .
Sending build context to Docker daemon 2.048kB
Step 1/4 : FROM debian:stretch
---> 6d83de432e98
Step 2/4 : RUN apt-get update
---> Using cache
---> 5ad3bd342683
Step 3/4 : RUN apt-get install -y git
---> Using cache
---> 29bdeb15539f
Step 4/4 : RUN git clone https://github.com/ishpreet-singh/Sudoku.git
---> Running in 613bdd58bc99
Cloning into 'Sudoku'...
---> ba9f61f10baf
Removing intermediate container 613bdd58bc99
Successfully built ba9f61f10baf
Successfully tagged img2:latest
The repository will be cloned to theWORKDIR
directory which defaults to /
.存储库将被克隆到默认为
/
的WORKDIR
目录。
So after logging into container you'll find the cloned repository under /Sudoku
.因此,登录容器后,您将在
/Sudoku
下找到克隆的存储库。
Cloning a git repo using docker seems to be a strange scenario?使用 docker 克隆 git repo 似乎是一个奇怪的场景? Why would one do that?
为什么要这样做?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.