我正在尝试构建一个简单的Spring应用程序的映像,并将Websphere liberty的基本映像安装为Root应用程序。
虽然它在本地构建并且运行良好,但是当使用Kaniko (Jenkins使用)构建时,相同的映像不能正确构建。
示例项目- wslc的https://github.com/dhananjay12/ci-cd-spring-project Docker文件- https://github.com/dhananjay12/ci-cd-spring-project/blob/master/Dockerfile-wslc
FROM websphere-liberty:18.0.0.4-javaee7
# Copy war file to apps folder
ADD ./target/ci-cd-spring-project*.war config/apps/ci-cd-spring-project.war
# Define the root context path for application
RUN sed -i "0,/<\/server>/s/<\/server>/ <webApplication contextRoot=\"\/\" location=\"ci-cd-spring-project.war\" \/>\n\n&/" config/server.xml它在本地构建和运行得很好。
在从kaniko构建时,镜像有点损坏,在运行时,我得到以下错误
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: failed to register layer: Error processing tar file(exit status 1): mkdir /config/apps: no such file or directory.
See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.有什么建议吗?
发布于 2019-11-05 10:14:41
问题是/config是一个符号链接
config -> /opt/ibm/wlp/usr/servers/defaultServer直接将文件添加到/opt/ibm/wlp/usr/servers/defaultServer/apps/解决了这个问题
https://stackoverflow.com/questions/58210028
复制相似问题