You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried to build a simple repo with the same docker image and shell scripts, it works.
I noticed that the building get slower when I generated a 1GB file with truncate -s 1G block in the work directory. It will get back to normal when set .dockerignore to ignore the block file.
Although I have ignored many things in the large project via .dockerignore, it still hang.
How can I debug the habitus server?
I think it is due to some large files still omitted to ignore.
Is there any method to help detect the problem? Maybe Sending build context to Docker daemon XXX MB message is helpful.
Hi @adoyle-h. Hi need to investigate if I get the the size of the building context from the docker deamon API. Will put this on my todo list. Thanks for reaching out.
Okay, so it turns out that habitus relies on go-dockerclient and passes build context as a directory path rather than io.Reader which is required in order to calculate the progress.
Activity
adoyle-h commentedon Jul 25, 2017
I think it is due to some large files still omitted to ignore.
Is there any method to help detect the problem? Maybe
Sending build context to Docker daemon XXX MBmessage is helpful.foldingbeauty commentedon Jul 27, 2017
Hi @adoyle-h. Hi need to investigate if I get the the size of the building context from the docker deamon API. Will put this on my todo list. Thanks for reaching out.
mumoshu commentedon Mar 8, 2018
For anyone interested: The docker-build implementation seems to be here: https://github.com/docker/cli/blob/82a80858857aeeb37008bd7d2f4afcda3d39c966/cli/command/image/build.go#L333
mumoshu commentedon Mar 13, 2018
Okay, so it turns out that habitus relies on go-dockerclient and passes build context as a directory path rather than
io.Readerwhich is required in order to calculate the progress.Habitus: https://github.com/cloud66/habitus/blob/5d45985f7af33d1a6bcbb5c782f80fcf39b829da/build/builder.go#L267
go-dockerclient: https://github.com/fsouza/go-dockerclient/blob/cb0ae363fa010610c248eb6a397aa72345b4b406/image.go#L489
Official docker client: https://github.com/moby/moby/blob/3a633a712c8bbb863fe7e57ec132dd87a9c4eff7/client/image_build.go#L21
Fortunately, we can switch habitus to pass an
InputStream. The input stream could be created from a tar stream and can we wrapped with a progress reader to achieve what we want.