java - How to run the COPY and RUN command in same container? -


i trying install java rpm file docker centos image.

> step 0 : centos:latest  ---> **34943839435d** step 1 : copy . jdk-6u45-linux-x64-rpm.bin  ---> **2055e5db6ae9** removing intermediate container 7ae13aaa4424 step 2 : run chmod +x jdk-6u45-linux-x64-rpm.bin &&     sh jdk-6u45-linux-x64-rpm.bin  ---> running in **c4d6b63576bc** jdk-6u45-linux-x64-rpm.bin: jdk-6u45-linux-x64-rpm.bin: directory 2014/12/16 06:03:34 command [/bin/sh -c chmod +x jdk-6u45-linux-x64-rpm.bin &&  sh jdk-6u45-linux-x64-rpm.bin] returned non-zero code: 126 

the error gives seems because of different containers. how run command on same container?

docker file below

from    centos:latest  # install java. copy . jdk-6u45-linux-x64-rpm.bin  run chmod +x jdk-6u45-linux-x64-rpm.bin && \         sh jdk-6u45-linux-x64-rpm.bin 

syntax of copy follows:

copy <src>... <dest> 

so copy . jdk-6u45-linux-x64-rpm.bin mean copy current directory jdk-6u45-linux-x64-rpm.bin. hence error.

this should give want:

copy jdk-6u45-linux-x64-rpm.bin jdk-6u45-linux-x64-rpm.bin 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -