Docker:克隆当前目录下的git仓库

我正在使用docker克隆公共存储库。 它被克隆成功。 但是我不知道它的克隆位置在哪里? 另外我怎样才能克隆使用docker在我目前的工作目录回购?

Dockerfile

FROM debian:stretch RUN apt-get update RUN apt-get install -y git RUN git clone https://github.com/ishpreet-singh/Sudoku.git 

终奌站

 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 

存储库将被克隆到默认为/WORKDIR目录。

所以login到容器后,您会在/Sudoku下find克隆的存储库。

使用docker克隆git仓库似乎是一个奇怪的场景? 为什么要这样做呢?