docker下载tomcat并启动时失败,“Cannot find /usr/local/tomcat/bin/setclasspath.sh”

docker下载tomcat并启动时失败
报错信息如下:

Status: Downloaded newer image for tomcat:9.0
Cannot find /usr/local/tomcat/bin/setclasspath.sh
This file is needed to run this program

解决方法:在命令中加上 --privileged

# --privileged真正以root权限运行,否则容器内的root只是外部的普通权限
# --rm容器用完即删,不用手动删除
docker run -it --privileged --rm tomcat:9.0

参考文章

https://www.mdaima.com/it/2204.html

你可能感兴趣的:(tomcat,容器,docker)