简体   繁体   中英

docker exec -it bash gives error “executable file not found in $PATH” - but launching bash through Kitematic works

When I attempt to run docker exec -it bash I get the error executable file not found in $PATH"

I haven't been able to find much online pertaining to this issue. I was able to launch bash through Kitematic so it wasn't a big problem but I would love to know why it wouldn't let me launch bash with exec. This is my second day with Docker so i'm sure it's something simple but I really appreciate any help. I can get.

From your comment:

It doesn't say what executable specifically, here is the entire error: starting container process caused "exec: \\"-it\\": executable file not found in $PATH"

Actually, it does list the command, -it that it is looking to run. Everything after the container id is part of the command to run, and it looks like you've put the flags after the container id. You want:

docker exec -it $other_exec_flags $container_id $cmd_string

Or as Abhineet said:

docker exec -it <container_name> bash

Which is not the same as the failing command:

docker exec <container_name> -it bash

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM