【发布时间】:2018-09-06 11:54:15
【问题描述】:
我正在处理 docker 图像
在 docker 文件中设置 ...
# - Liberty installation of required features
RUN /opt/wlp/bin/featureManager install adminCenter-1.0 localConnector-1.0 jaxrs-1.1 jsp-2.2 jdbc-4.0 jndi-1.0 cdi-1.0 servlet-3.0 beanValidation-1.0 --when-file-exists=ignore --acceptLicense
RUN /opt/wlp/bin/server create my-server
...
但出现错误
CWWKE0005E: The runtime environment could not be launched.
CWWKE0045E: It was not possible to create the server called cca-dist-d because the server directory /srv/www/servers/my-server already exists.
ERROR: Service 'appserver' failed to build: The command '/bin/sh -c /opt/wlp/bin/server create my-server' returned a non-zero code: 1
有没有办法在创建或任何建议之前删除此类服务器?
只是为了注意 rm -R 不起作用:-(
RUN /bin/bash -c 'rm -R /opt/wlp/bin/server/my-server'
---> Running in 83f*****bd
rm: cannot remove '/opt/wlp/bin/server/my-server': Not a directory
【问题讨论】:
-
您正在尝试删除 bin/ 下不存在的不相关目录,并且您在 rm 命令中省略了 -f。