Reputation: 105
FROM java:8
RUN apt-get -y install git
RUN git clone https://username:[email protected]/<repo> C:/Users/USER/Desktop/gitFolder
COPY C:/Users/USER/Desktop/gitFolder /var/www/java
WORKDIR /var/www/java
RUN javac helloWorld.java
CMD ["java", "helloWorld"]
I am a beginner in docker and these are the docker commands i am following to run a javacode which is taken from github.Even though it is not giving any error during cloning,nothing is getting cloned in the gitFolder.
Upvotes: 4
Views: 10571
Reputation: 190
the path C:/Users/USER/Desktop/gitFolder is inexistent in your docker container.
RUN apt-get -y install git
RUN git clone https://username:[email protected]/<repo> C:/Users/USER/Desktop/gitFolder
you could do this
FROM java:8
RUN apt-get -y install git
RUN mkdir -p /var/www/java
WORKDIR /var/www/java
RUN git clone https://github.com/beeradb/kubectl-slackbot.git
...
Upvotes: 4