docker / for-win

Bug reports for Docker Desktop for Windows
https://www.docker.com/products/docker#/windows
1.86k stars 290 forks source link

Stuck on "Sending build context to Docker daemon" #576

Closed PetaPetaPeta closed 7 years ago

PetaPetaPeta commented 7 years ago

Expected behavior

I have an container that should have a build context of 32 mb. When I run docker build . I expect the container to be built.

Actual behavior

When I run docker build . it is stuck on Sending build context to Docker daemon 1.114 MB. I have tried with the same image(private image) on a different laptop, but under the same setup and the result is the same. I have tr

Information

Server: Version: 17.03.0-ce API version: 1.26 Go version: go1.7.5 Git commit: 3a232c8 Built: Tue Feb 28 07:52:04 2017 OS/Arch: linux/amd64 Experimental: true


### Steps to reproduce the behavior

  1.  `mkdir src`
  2.  `dd if=/dev/zero of=src/output.dat  bs=32M  count=1`
  3.  Create a Dockerfile with contents:

FROM ubuntu:14.04

COPY src/ /opt


  4.  `docker build .`
PetaPetaPeta commented 7 years ago

I just attempted to update to the latest version on docker on unix such that server and client matches.

Client:                                                                                                                                                                                                                               [9/1680] Version:      17.03.0-ce
 API version:  1.26
 Go version:   go1.7.5
 Git commit:   3a232c8
 Built:        Tue Feb 28 07:57:58 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.03.0-ce
 API version:  1.26 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   3a232c8
 Built:        Tue Feb 28 07:52:04 2017
 OS/Arch:      linux/amd64
 Experimental: true

This gives me the following:

➜  docker docker build .
Sending build context to Docker daemon 557.1 kB
PetaPetaPeta commented 7 years ago

I have found this thread which seems to document some of the same issues, but without a solution. It should be noted that if I create a docker-compose.yml-file and try to build from there it functions as expected. Here is a small snippet from the log.txt-file after running both docker build . and docker-compose build:

[14:12:18.696][ApiProxy       ][Info   ] proxy >> GET /_ping
[14:12:18.696][ApiProxy       ][Info   ] Dial Hyper-V socket b7f71aee-22b3-4d18-aa32-10936e7cc282:23a432c2-537a-4291-bcb5-d62504644739
[14:12:18.697][ApiProxy       ][Info   ] Successfully dialed Hyper-V socket b7f71aee-22b3-4d18-aa32-10936e7cc282:23a432c2-537a-4291-bcb5-d62504644739
[14:12:18.698][ApiProxy       ][Info   ] proxy << GET /_ping
[14:12:18.701][ApiProxy       ][Info   ] proxy >> POST /v1.26/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&ulimits=null
[14:12:18.701][ApiProxy       ][Info   ] Dial Hyper-V socket b7f71aee-22b3-4d18-aa32-10936e7cc282:23a432c2-537a-4291-bcb5-d62504644739
[14:12:18.702][ApiProxy       ][Info   ] Successfully dialed Hyper-V socket b7f71aee-22b3-4d18-aa32-10936e7cc282:23a432c2-537a-4291-bcb5-d62504644739
[14:12:30.199][ApiProxy       ][Info   ] proxy >> POST /v1.21/build?q=False&pull=False&t=docker_test&nocache=False&forcerm=False&rm=True
[14:12:30.199][ApiProxy       ][Info   ] Dial Hyper-V socket b7f71aee-22b3-4d18-aa32-10936e7cc282:23a432c2-537a-4291-bcb5-d62504644739
[14:12:30.200][ApiProxy       ][Info   ] Successfully dialed Hyper-V socket b7f71aee-22b3-4d18-aa32-10936e7cc282:23a432c2-537a-4291-bcb5-d62504644739
[14:12:30.592][ApiProxy       ][Info   ] proxy << POST /v1.21/build?q=False&pull=False&t=docker_test&nocache=False&forcerm=False&rm=True

The docker client seems to use the v1.26 API which the docker-compose client uses the v1.21 client. Could this be a regression with a new API version?

friism commented 7 years ago

I think this is a known bug in WSL: https://github.com/Microsoft/BashOnWindows/issues/1123#issuecomment-249452291

Fwiw I can't repro on my latest insider build so it's possible that they fixed it:

C:\Users\Michael Friis> [System.Environment]::OSVersion.Version

Major  Minor  Build  Revision
-----  -----  -----  --------
10     0      15055  0
friism@LAPTOP-G8D4BRBC:~/repro/build-hang$ docker -H localhost:2375 build .
Sending build context to Docker daemon 33.56 MB
Step 1/2 : FROM ubuntu:14.04
 ---> 7c09e61e9035
Step 2/2 : COPY . /test
 ---> 676c3ca04b6e
Removing intermediate container 4581324384df
Successfully built 676c3ca04b6e
friism@LAPTOP-G8D4BRBC:~/repro/build-hang$
ArthurZ commented 6 years ago

In my case a co-worker advised to assign more runnable memory to Docker which helped.

docker-robott commented 4 years ago

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle locked