-1

I have a dockerfile which downloads file through wget and in the next step when I try to "RUN unzip . I get the below error.

Step 10/27 : RUN wget http://artifactory.orbit8.com/artifactory/build-dependencies/7.2.0/ext-7.2.0.zip -P /var/jenkins_home/Extjs_7.2.0
 ---> Using cache
 ---> bb39b7a46fd1
Step 11/27 : RUN unzip /var/jenkins_home/Extjs_7.2.0/epa-7.2.0.zip -d /var/jenkins_home/Extjs_7.2.0
 ---> Running in 515e6e4e5456
unzip:  cannot find or open /var/jenkins_home/Extjs_7.2.0/epa-7.2.0.zip, /var/jenkins_home/Extjs_7.2.0/epa-7.2.0.zip.zip or /var/jenkins_home/Extjs_7.2.0/epa-7.2.0.zip.ZIP.
Joe
  • 41,484
  • 20
  • 104
  • 125
  • 2
    You ran a wget on `ext-7.2.0.zip` and tried to unzip `epa-7.2.0.zip` – BMitch Sep 05 '21 at 18:49
  • The other thing I'd check is if there's a `VOLUME /var/jenkins_home` declaration; that would cause the result of the `wget` to be lost (even if it had the right filename). Can you edit the question to include the complete Dockerfile? – David Maze Sep 05 '21 at 18:54
  • Please provide enough code so others can better understand or reproduce the problem. – Community Sep 10 '21 at 13:00

1 Answers1

2

BMitch said it. you missed the right naming. Also dont forget to execute wget and unzip and rm in one layer otherwise you will waste resources. (Multiple RUN vs. single chained RUN in Dockerfile, which is better?)

Try this :

RUN wget http://artifactory.orbit8.com/artifactory/build-dependencies/7.2.0/ext-7.2.0.zip -P /var/jenkins_home/Extjs_7.2.0 && \
    unzip /var/jenkins_home/Extjs_7.2.0/epa-7.2.0.zip -d /var/jenkins_home/Extjs_7.2.0 && \
    rm /var/jenkins_home/Extjs_7.2.0/epa-7.2.0.zip

Raphael PICCOLO
  • 2,095
  • 1
  • 12
  • 18