docker / docker/cli

Docker exits with error if STDIN is large and not fully consumed.

Open
#1,456 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/builder version/1.13
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

  • This is a bug report
  • This is a feature request
  • I searched existing issues before opening this one
Expected behavior

Docker run should exit cleanly regardless of the size of the stream to STDIN.

Actual behavior

When reading only a part of STDIN, if the remaining stream is large, docker has an error and exits with a failure code.

Steps to reproduce the behavior

Here is an example dockerfile and commands to reproduce:

milesc@torre 0 tmp-docker ↠ cat Dockerfile 
FROM library/ubuntu:16.04
ENTRYPOINT ["head", "-n", "1"]

milesc@torre 0 tmp-docker ↠ cat bigfile | docker run -i example && echo "sucesss"
paperid	paper_title	publisher	doi	field	pdf_processed	viewable	users_28days	users_7days	frac_users_28days	frac_users_7days
read unix @->/var/run/docker.sock: read: connection reset by peer

milesc@torre 0 tmp-docker ↠ head bigfile | docker run -i example && echo "sucesss"
paperid	paper_title	publisher	doi	field	pdf_processed	viewable	users_28days	users_7days	frac_users_28days	frac_users_7days
sucesss

bigfile is about 10,000 lines of csv. Notice the difference in behavior between "cat" and "head"

Output of docker version:

Client:
 Version:      1.13.1
 API version:  1.26
 Go version:   go1.8.3
 Git commit:   092cba3
 Built:        Thu Oct 12 22:34:44 2017
 OS/Arch:      linux/amd64

Server:
 Version:      1.13.1
 API version:  1.26 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   092cba3
 Built:        Thu Oct 12 22:34:44 2017
 OS/Arch:      linux/amd64
 Experimental: false

Output of docker info:

Containers: 57
 Running: 0
 Paused: 0
 Stopped: 57
Images: 2186
Server Version: 1.13.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 632
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1
runc version: 9df8b306d01f59d3a8029be411de015b7304dd8f
init version: N/A (expected: 949e6facb77383876aeff8a6944dde66b3089574)
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.13.0-32-generic
Operating System: Ubuntu 17.10
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 15.07 GiB
Name: torre
ID: 6NFL:O6V4:ZP6D:WYSE:PW2G:MXWI:GZ6L:BC3E:UAW5:ERXJ:Z2VG:G7SH
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior with the shown Dockerfile, cat bigfile | docker run -i example, and head bigfile | docker run -i example. Trace the Docker CLI's STDIN handling and compare both cases; done means the large, partially consumed stream exits cleanly without a connection-reset failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.