2

I have multiple Dockerfiles in a different folder but the source for all the dockers is the same.

FROM openjdk:11.0.5-stretch

COPY my.zip /home/my.zip

RUN unzip /home/target.zip -d /home/ && rm -f /home/target.zip

ENTRYPOINT ["java", "-jar", "/home/my/{a.jar, b.jar, ...}"

Either one of the jar will be used in one Docker file. I have a python script which runs all the docker build commands, whenever I update something in code and recompile, I have to copy my.zip in almost 20 folders. Is it possible we ADD the file from the root folder as

ADD ../my.zip /home/my.zip

Is it possible?

IceBurger
  • 155
  • 1
  • 8
Cool Java guy מוחמד
  • 1,687
  • 4
  • 24
  • 40

1 Answers1

0

Try building docker images from the parent directory with "-f" flag:

 docker build -t <your_tag> -f dirA/dirB/Dockerfile .
Mark Bramnik
  • 39,963
  • 4
  • 57
  • 97