我正在尝试从 github 构建 docker 映像。我正在运行以下命令来构建映像。
docker build -t test1:latest https://github.com/syndy1989/Accessibility.git
我得到以下错误:
PS C:\Users\Administrator> docker build -t test1:latest https://github.com/syndy1989/Accessibility.git
Sending build context to Docker daemon 78.03 MB
Step 1/13 : FROM 474614/my_repo1:windows_java_git
---> 2732d0c2549b
Step 2/13 : RUN git clone https://github.com/syndy1989/Accessibility.git
---> Using cache
---> 57ad907abaf6
Step 3/13 : RUN mkdir C:\\axe_accessibility
---> Using cache
---> 5b1f12fd22a3
Step 4/13 : WORKDIR C:\\axe_accessibility
---> Using cache
---> 196d2ceb8f72
Step 5/13 : COPY Sample.java C:\\axe_accessibility\\Sample.java
---> Using cache
---> 71ebbef33f51
Step 6/13 : COPY axe.min.js C:\\axe_accessibility\\axe.min.js
---> Using cache
---> c1804bd1708c
Step 7/13 : COPY phantomjs.exe C:\\axe_accessibility\\phantomjs.exe
---> Using cache
---> 0bd0796ee072
Step 8/13 : COPY datafile.properties C:\\axe_accessibility\\datafile.properties
---> Using cache
---> 68565416a292
Step 9/13 : COPY ./lib C:\\axe_accessibility\\lib
---> Using cache
---> 348c0cbcf842
Step 10/13 : WORKDIR C:\\axe_accessibility
---> 3678f4222d27
Removing intermediate container c33f1296c6a9
Step 11/13 : RUN javac -cp "./lib/*;" Sample.java
---> Running in 7216fd466a66
javac: no source files
Usage: javac <options> <source files>
use -help for a list of possible options
Sample.java : The term 'Sample.java' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.
At line:1 char:95
+ ... ogressPreference = 'SilentlyContinue'; javac -cp ./lib/*; Sample.java
+ ~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Sample.java:String) [], ParentC
ontainsErrorRecordException
+ FullyQualifiedErrorId : CommandNotFoundException
The command 'powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; javac -cp ".
/lib/*;" Sample.java' returned a non-zero code: 1
当我检查 Docker 容器内部时,sample.java 被复制到文件夹 C:/axe_accessibility 中。我能够在容器内编译,但是在构建图像时它不起作用。对此的任何建议都会有所帮助。提前致谢。