Home > database >  Git clone not coping in to WORKDIR [ Dockerfile ]
Git clone not coping in to WORKDIR [ Dockerfile ]

Time:02-04

while building a docker image - RUN git clone [email protected] is working. But i can't able to move the exact app.py in to WORKDIR (Dockerfile), which is in the git repo.

you can see my git Here is my Folder structure

Here is my Output Terminal.

Sending build context to Docker daemon  4.096kB
Step 1/9 : FROM python:3
 ---> e2e732b7951f
Step 2/9 : RUN apt-get update && apt-get install -y     build-essential     libpng-dev     libjpeg62-turbo-dev     libfreetype6-dev     locales     zip     jpegoptim optipng pngquant gifsicle     vim     unzip     git     curl
 ---> Using cache
 ---> 93a0e5877ac6
Step 3/9 : RUN git clone https://github.com/testgithub-trial/docktest.git
 ---> Using cache
 ---> 36313099edf8
Step 4/9 : WORKDIR /usr/src/app
 ---> Using cache
 ---> 35c1e7a26f44
Step 5/9 : ADD /docktest /usr/src/app
ADD failed: file not found in build context or excluded by .dockerignore: stat docktest: file does not exist

CodePudding user response:

You'll want to RUN mv /docktest /usr/src/app. ADD is for files in the build context (your machine), not ones in the image itself

  •  Tags:  
  • Related