【docker报错】starting container process caused "exec: \"-P8080:8080\": executable file not found in $PATH".

docker创建tomcat容器报错:

[root@iz2ze278r1bkrzjgp5tf08z ~]# docker run -di --name=tomcat tomcat:latest -P8080:8080
6ff68159042bf87347bc9570d4ab8151fe8ff3b5bc60333718f6a0f8fd95af5b
/usr/bin/docker-current: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"-P8080:8080\": executable file not found in $PATH".

解决: 将-p前移即可.
[root@iz2ze278r1bkrzjgp5tf08z ~]# docker rm tomcat
tomcat

[root@iz2ze278r1bkrzjgp5tf08z ~]# docker run -di --name=tomcat -p 8080:8080 tomcat:latest
c57b2e85c0ccc646aeacf2b8eef40314711ac87bbb727b0a889121424aa26f70

猜你喜欢

转载自www.cnblogs.com/163-4630227/p/10010089.html