Why does “docker attach” hang?

前端 未结 6 2071
借酒劲吻你
借酒劲吻你 2020-12-13 17:17

I can run an ubuntu container successfully:

# docker run -it -d ubuntu
3aef6e642327ce7d19c7381eb145f3ad10291f1f2393af16a6327ee78d7c60bb
# dock         


        
6条回答
  •  甜味超标
    2020-12-13 17:46

    When I run docker attach container-name, then nothing output, even Ctrl-c is invalid. So, first try

    docker attach container-name --sig-proxy=false
    

    and then ctrl-c can stop it. Why it didn't output anything? just because the container doesn't output. Actually I need to enter my container and run some shell command. So the correct command is

    docker exec -ti container-name bash
    

提交回复
热议问题