Reputation: 75
I am trying to git clone repo to my machine(locally) while running dockerfile.
But, it is cloning in to container.
I need to be cloned to my local machine, ple correct me if my Dockerfile is wrong.
Here is my Docker file
FROM python:3
RUN apt-get update && apt-get install -y \
git
WORKDIR /usr/src/app
RUN git clone https://github.com/testgithub-trial/docktest.git
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD [ "python", "main.py" ]
Upvotes: 0
Views: 456
Reputation: 140880
how git clone locally (to my machine) using Dockerfile?
It is not possible to do anything to your machine from Dockerfile.
I need to be cloned to my local machine
So do not use a Dockerfile. You can do from a docker container by bind-mounting a directory, but not from docker build
.
Upvotes: 4