Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Divergence on 'docker attach' #99

Open
davefinster opened this issue Nov 21, 2016 · 0 comments
Open

Divergence on 'docker attach' #99

davefinster opened this issue Nov 21, 2016 · 0 comments

Comments

@davefinster
Copy link

While doing work on getting Gitlab CI runners operational with Triton Docker, I came across an issue whereby the use of the attach endpoints (programatically and through the docker client binaries) would not make any progress.

As some background, the strategy that Gitlab uses with Docker containers is:

  • Create the container with OpenStdin: true and StdinOnce: true and tty: false. The command supplied to the container is /bin/bash or some equivalent shell
  • Start the container
  • Attach to the container and execute the build command
  • Wait for the container to exit

The container should automatically exit once the 'Attach' step is complete, as per StdinOnce being set to true. On the normal Docker Engine, running on my local OS X (via Docker for Mac), this is what happens. When performing this against both JPC and a private Triton installation operating on the latest release sdc-docker, the attach call successfully connects (calling docker attach elsewhere results in a zlogin error about it already being in use) but it seems that stdin is not consumed. As such, the attach call just hangs and eventually times out.

I've yet to perform sdc-docker tracing against this problem, but a quick overview of the logs show the connection entering the half-closed state and then there are no more entries.

I've written a small test program here that demonstrates the problem. It requires a local Docker of Mac installation and the Makefile needs to be modified to point to the docker certs folder, but that is detailed in that repo.

An example from that test program of the divergence, which is done against an ubuntu:16.10 container running with settings created as per the first step noted above. The program attaches to the container, supplies 'echo "Working"' over stdin and pipes the stdout/stderr of the container (via attach) to the programs stdout/err.

Docker Engine:

Pulling Image
Image Pulled - Building Container
Built Container with ID 743a8b6cf1abf83f4dea5f307b0a71360080e10c681cf722e96f88342ae3404f
Starting Container
Container started - Attaching
Working
Attachment complete - Waiting for Container to Exit
Exit Code (which should be 0) 0
Removing container

sdc-docker:

Pulling Image
Image Pulled - Building Container
Built Container with ID 743a8b6cf1abf83f4dea5f307b0a71360080e10c681cf722e96f88342ae3404f
Starting Container
Container started - Attaching

Once attached, sdc-docker makes no forward progress and eventually times out.

I'll update this issue with any more details that I find after tracing (aiming to collect packet dumps)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant