我正在尝试将 java 从 rpm 文件安装到 docker centos 映像。
> Step 0 : FROM 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: is a directory
2014/12/16 06:03:34 The command [/bin/sh -c chmod +x jdk-6u45-linux-x64-rpm.bin && sh jdk-6u45-linux-x64-rpm.bin] returned a non-zero code: 126
它给出的错误似乎是因为不同的容器。如何在同一个容器上运行命令?
Docker文件如下
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