how to copy folders and subfolders in dockerfile outside build context

Viewed 436

how to copy folders and subfolders in dockerfile outside build context

Folder structure
Documents
--repo
  -- ab
   -- 1
   -- 2
   -- 3
  -- bc
   -- 5
   -- 6 
   -- 7
--pipleine
  -- dockerfile

I need to add folders(ab and bc and its subfolders) inside the dockerfile to build an image.

Docekrfile is

FROM ubuntu
RUN apt-get update && apt install sshpass
RUN mkdir -p /home/user
WORKDIR /home/user

# Install python requirements
RUN python -m pip install grpcio && python -m pip install grpcio-tools
RUN python -m pip install numpy==1.18.4 

ADD ab/* /home/user/ab/
ADD bc/* /home/user/bc/

And run docker build -f /home/user/Documents/pipeline/dockerfile -t new6 /home/user/Documents/repo

this will copy files not folders.

0 Answers
Related