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

Progress is redirected to output on Travis-CI #863

Open
moikot opened this Issue Mar 11, 2019 · 6 comments

Comments

Projects
None yet
3 participants
@moikot
Copy link

moikot commented Mar 11, 2019

I'm trying to build my Docker images on Travis-CI and redirect output back to Docker using these options:

 --exporter docker --exporter-opt name="${image}:${tag}" |  docker load 

But it is failing with message:

Error processing tar file(exit status 1): archive/tar: invalid tar header

I investigated the issue and found out that the stderr output used for progress is mixed with stdout and everything is streamed into Docker.

@AkihiroSuda

This comment has been minimized.

Copy link
Member

AkihiroSuda commented Mar 12, 2019

Please try mkfifo a.tar; buildctl build --output type=docker,name="${image}:${tag}",dest=a.tar ... & docker load < a.tar & wait

@tonistiigi

This comment has been minimized.

Copy link
Member

tonistiigi commented Mar 12, 2019

@AkihiroSuda What would be the reason the more hacky version is needed? buildctl should not print any progress output to stdout.

@AkihiroSuda

This comment has been minimized.

Copy link
Member

AkihiroSuda commented Mar 12, 2019

I thought it makes sense to use stdout for --progress=plain, but no strong opinion

@tonistiigi

This comment has been minimized.

Copy link
Member

tonistiigi commented Mar 12, 2019

Ah, didn't realize it was from the progress value. Yes, I think we should fix it and always put the progress to stderr.

@AkihiroSuda AkihiroSuda added bug exp/beginner and removed question labels Mar 12, 2019

@moikot

This comment has been minimized.

Copy link
Author

moikot commented Mar 12, 2019

@AkihiroSuda The trick with fifo worked perfectly, thank you! How I missed that dest option exists for output so that you can specify a file?

@AkihiroSuda

This comment has been minimized.

Copy link
Member

AkihiroSuda commented Mar 12, 2019

The CLI was massively updated in #807

--output type=docker,name="${image}:${tag}",dest=a.tar can be also written in the legacy form: --exporter docker --exporter-opt name="${image}:${tag}" --exporter-opt output=a.tar.

@tonistiigi tonistiigi added this to the v0.5.0 milestone Mar 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
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.