Entering two letters at the same time causes the docker exec -it shell to fail

I am running the Docker Toolbox on VirtualBox on Windows 10.

I have an annoying problem when, if I'm docker exec -it mycontainer shin a container, to check things, the shell will suddenly return to the host shell, and I will type commands. Some experiments show that this is when I press two letters at the same time (as is usually the case when typing), which causes an exit.

The container will still work.

Any idea what this is?

More details

Here's a minimal docker image that I'm running inside. Essentially, I'm trying to deploy kubernetes clusters in AWS through kops, but since I'm on Windows, I have to use a container to run kops commands.

FROM alpine:3.5

#install aws-cli
RUN apk add --no-cache \
  bind-tools\
  python \
 python-dev \
 py-pip \
 curl


RUN pip install awscli 

#install kubectl
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
RUN chmod +x ./kubectl
RUN mv ./kubectl /usr/local/bin/kubectl


#install kops
RUN curl -LO https://github.com/kubernetes/kops/releases/download/$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)/kops-linux-amd64
RUN chmod +x kops-linux-amd64
RUN mv kops-linux-amd64 /usr/local/bin/kops

I am creating this image:

docker build -t mykube . 

, :

docker run -dit -v "${PWD}":/app mykube

I exec :

docker exec -it $containerid sh 

AWS .

:

##output of previous dig command 
;; Query time: 343 msec
;; SERVER: 10.0.2.3#53(10.0.2.3)
;; WHEN: Wed Feb 14 21:32:16 UTC 2018
;; MSG SIZE  rcvd: 188

##me entering a command
/ # aws s3 mb s3://clus
##shell exits abruptly to host shell while I'm writing
DavidJ@DavidJ-PC001 MINGW64 ~/git-workspace/webpack-react-express (master)
##container is still running 
$ docker ps --all
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
37a341cfde83        mykube              "/bin/sh"           5 minutes ago       Up 3 minutes                            gifted_bhaskara
##nothing in docker logs
$ docker logs --details 37a341cfde83

-D :

$ docker -D exec -it  04eef8107e91 sh -x
DEBU[0000] Error resize: Error response from daemon: no such exec
                                                                  / #
/ #
/ #
/ #
/ # sdfsdfjskfdDEBU[0006] [hijack] End of stdin
DEBU[0006] [hijack] End of stdout

, , , , - ( ).

, github , , .

+6
3

. . github.

, docker exec winpty, git bash.

.

winpty docker exec -it mycontainer sh
+3

USER, docker exec -it yourContainer sh.
.bahsrc, .bash_profile .profile , , .

, (docker logs --details yourContainer), , - stderr.

+1

, , , :

  • Pid 1, . , , . . docker container inspect, , . , .
  • , ​​ . dmesg, , .
  • , , . docker container inspect, .
  • , .
  • , selinux apparmor.
  • Network problems. I never came across this myself, but since docker is a client-server design, it is possible to disconnect the network in order to delete the exec session.
  • The server itself is not working, and you will see various logs in syslog / dmesg indicating problems due to which it cannot recover.
+1
source

All Articles