Why does “docker attach” hang?

前端 未结 6 2069
借酒劲吻你
借酒劲吻你 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

    I just had a similar problem today and was able to fix it:

    Here is what was happening for me:

    docker-compose logs -f nginx
    Attaching to laradock_nginx_1
    

    Then it would hang there until I quit via CTRL-C: ^CERROR: Aborting.

    docker ps -a showed that what SHOULD have been called laradock_nginx did not exist with that Image Name, so I figured I'd just remove and re "up" that container:

    docker stop cce0c32f7556
    docker rm cce0c32f7556
    docker-compose up -d laradock_nginx
    

    Unfortunately: ERROR: No such service: laradock_nginx

    So I did a sudo reboot and then docker ps -a, but laradock_nginx still wasn't there.

    Luckily, docker-compose up -d nginx then worked and docker-compose logs -f nginx now works.

提交回复
热议问题