title: Dockerfile build image unable to find yum downloads
body: <p>In my dockerfile I am downloading JDK17, and copying to another directory to build my image. It downloads fine, and when I do an ls, I do see the files. But when I later do an ADD from this location to another location in my container, it does not find the file.</p>
  <p>Here is my dockerfile:</p>
  <pre><code>FROM oraclelinux:9
  
  ENV JAVA_PKG=java-17-openjdk-17.0.4.0.8-2.el9_0.x86_64.rpm \
      JAVA_HOME=/usr/java/default \
      HTTP_PROXY=http://myproxyhost:port \
      HTTPS_PROXY=http://myproxyhost:port 
  
  RUN yum install yum-utils
  RUN yumdownloader --destdir target/installer java-17-openjdk -y
  RUN ls target/installer
  RUN ls target
  RUN ls
  RUN pwd
  
  ADD target/installer/$JAVA_PKG /usr/java/ -&gt; FAILS
  
  </code></pre>
  <p>Docker image run output</p>
  <pre><code>Step 1/23 : FROM oraclelinux:9
   ---&gt; fa05a8a60339
  
  Step 2/23 : ENV JAVA_PKG=java-17-openjdk-17.0.4.0.8-2.el9_0.x86_64.rpm     JAVA_HOME=/usr/java/default     HTTP_PROXY=http://.......
   ---&gt; Running in bdbf6f67cda5
  
  Removing intermediate container bdbf6f67cda5
   ---&gt; 9a522a690d6a
  
  Step 3/23 : RUN yum install yum-utils
   ---&gt; Running in 636d098e505b
  
  Oracle Linux 9 BaseOS Latest  (x86_64)          3.5 MB/s | 3.6 MB     00:01    
  Oracle Linux 9 Application Stream Packages (x86 6.2 MB/s | 8.8 MB     00:01    
  Last metadata expiration check: 0:00:01 ago on Mon Sep 12 17:32:01 2022.
  Package yum-utils-4.0.24-4.0.1.el9_0.noarch is already installed.
  Dependencies resolved.
  Nothing to do.
  Complete!
  
  Removing intermediate container 636d098e505b
   ---&gt; 73abef1e3ed6
  
  Step 4/23 : RUN yumdownloader --destdir target/installer java-17-openjdk -y
   ---&gt; Running in cee9d1d620db
  Last metadata expiration check: 0:00:06 ago on Mon Sep 12 17:32:01 2022.
  java-17-openjdk-17.0.4.0.8-2.el9_0.x86_64.rpm   682 kB/s | 244 kB     00:00    
  Removing intermediate container cee9d1d620db
   ---&gt; 6ead60b4a32e
  
  Step 5/23 : RUN ls target/installer
   ---&gt; Running in 6ce3fa03457c
  
  java-17-openjdk-17.0.4.0.8-2.el9_0.x86_64.rpm -----&gt; **File is there**
  
  Removing intermediate container 6ce3fa03457c
   ---&gt; 68c624f00c20
  
  Step 6/23 : RUN ls target
   ---&gt; Running in 5e84a200d2d8
  
  installer
  
  Removing intermediate container 5e84a200d2d8
   ---&gt; b531e9c68a19
  
  Step 7/23 : RUN ls
   ---&gt; Running in bb11fddb08bc
  
  afs
  ....
  dev
  etc
  ....
  opt
  proc
  root
  ...
  srv
  sys
  **target** --------&gt; **It is there**
  
  ...
  
  Removing intermediate container bb11fddb08bc
   ---&gt; 7e8da24633f9
  
  Step 8/23 : RUN pwd
   ---&gt; Running in 3ca7fbfaa1c7
  
  /
  
  Removing intermediate container 3ca7fbfaa1c7
   ---&gt; bcc07f5b27e4
  
  Step 9/23 : ADD target/installer/$JAVA_PKG /usr/java/
  
  </code></pre>
  <p>this Step 9 here fails with error:</p>
  <pre><code>ADD failed: stat/scratch/docker/tmp/docker-builder814075534/target/installer/java-17-openjdk-17.0.4.0.8-2.el9_0.x86_64.rpm: no such file or directory
  </code></pre>
  <p>Why is it looking in this directory? When I do pwd I am in a &quot;/&quot; directory. ls shows me correct path too. How do I make docker image find my downloaded file?</p>
  <p>Appreciate your help
  thanks</p>