compose-cli icon indicating copy to clipboard operation
compose-cli copied to clipboard

Terminal hangs when using docker exec with Microsoft Azure Container Instances (ACI) integration

Open pcgeek86 opened this issue 4 years ago • 8 comments

Description

I followed the documentation to connect the Docker CLI to Microsoft Azure Container Instances (ACI). Once I spun up a sample NGINX container, I wanted to exec into the ACI container group. Once I did this, according to the documentation, my terminal completely hung.

Steps to reproduce the issue:

  1. docker login azure
  2. docker context create aci myacicontext
  3. docker --context myacicontext run -p 80:80 nginx
  4. CTRL + C
  5. docker exec --tty <CONTAINER_ID> bash

Describe the results you received:

  • Terminal completely hung.
  • CTRL+C doesn't work.
  • CTRL+P, CTRL+Q doesn't work.
  • Typing any standard keyboard characters doesn't work.

Describe the results you expected:

My Bash terminal in the ACI container group should be interactive and usable to explore inside the container.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Client:
 Cloud integration: 1.0.17
 Version:           20.10.7
 API version:       1.41
 Go version:        go1.16.4
 Git commit:        f0df350
 Built:             Wed Jun  2 12:00:56 2021
 OS/Arch:           windows/amd64
 Context:           trevoraci
 Experimental:      true

Output of docker info:

Not available in Docker ACI integration mode.

Command "info" not available in current context (trevoraci), you can use the "default" context to run this command

Additional environment details (AWS, VirtualBox, physical, etc.):

  • Windows 10 Developer Preview Build 21387
  • Windows Terminal 1.8.1521.0
  • PowerShell Core 7.1.3

pcgeek86 avatar Jun 30 '21 15:06 pcgeek86

I think this is a doc bug. Adding --interactive works fine when using exec, but not when using run.

C:\> docker run -it nginx
unknown shorthand flag: 'i' in -it
C:\> docker exec -it peaceful-mendel bash
root@SandboxHost-637606665499607545:/# asdfasdfasdfasdfasd

pcgeek86 avatar Jun 30 '21 16:06 pcgeek86

I also noticed that exiting out of an interactive process in a container results in a weird error message.

C:\> docker exec -it peaceful-mendel bash
root@SandboxHost-637606665499607545:/# asdffdsdsf
bash: asdffdsdsf: command not found
root@SandboxHost-637606665499607545:/# exit
exit
command terminated with non-zero exit code: error executing command [bash], exit code 127failed to read input from container: ws closed: 1000

It seems like the Docker CLI should close out of the interactive process more gracefully than it does.

pcgeek86 avatar Jun 30 '21 16:06 pcgeek86

Thanks for reporting; this looks like an issue with the "cloud" integration, which is maintained in the https://github.com/compose/compose-cli repository; let me transfer this ticket to that issue tracker

thaJeztah avatar Jun 30 '21 16:06 thaJeztah

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 03 '22 21:01 stale[bot]

Bump

pcgeek86 avatar Jan 04 '22 04:01 pcgeek86

This issue has been automatically marked as not stale anymore due to the recent activity.

stale[bot] avatar Jan 04 '22 04:01 stale[bot]

I had a similar issue today using Apple M1 Max MacBook Pro after using docker exec in a workshop. The process hanged and started causing issues for all Unix commands within the terminal. I had to quit Docker Desktop to get back to a normal state.

conradwt avatar Mar 03 '22 23:03 conradwt

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 21 '22 02:09 stale[bot]

This issue has been automatically closed because it had not recent activity during the stale period.

stale[bot] avatar Nov 02 '22 02:11 stale[bot]