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

Binary garbage on standard output of docker:install under Maven 3 #13

Closed
rkrzewski opened this issue Jul 14, 2014 · 9 comments
Closed
Assignees
Labels
Milestone

Comments

@rkrzewski
Copy link

While running docker:install goal, the following is printed to maven's standard output:

[INFO] 2 * Client out-bound request
2 > POST http://127.0.0.1:4243/v1.11/build?t=app-image_app
2 > Content-Type: application/tar
2 > Accept: text/plain
Dockerfile^@^@^@

... many megabytes of binary garbage omitted ...

^@^@^@

[INFO] 2 * Client in-bound response
2 < 200
2 < Content-Type: application/json
2 < Date: Mon, 14 Jul 2014 21:55:39 GMT
2 < Transfer-Encoding: chunked
2 < 

Debug output is nice, but dumping tar contents to the console is a tad excessive ;)

I was able to track this logging info to com.sun.jersey.api.client.filter.LoggingFilter added to Jersey ApacheHttpClient4 used by com.kpelykh.docker.client.DockerClient (introduced in commit alexec/docker-java-fix-its@7cbba4b)

Now, I see in https://github.com/alexec/docker-maven-plugin/blob/master/src/main/resources/logback.xml that the intention was to redirect this particular debug information into a file in project's target directory, but for some reason it does not work in the version of Maven I'm using (3.2.1). I presume it's different in your environment - it seems you are compiling against Maven 2.0.6 API.

It would be great if the capturing & logging of client/server communication were made optional. It's not needed when things are going well (hopefully most of the time) but capturing the stream using LoggingFilter and converting it into java.lang.String to write out to the log uses a lot of CPU cycles and memory.

@hanswesterbeek
Copy link

I am also experiencing this problem when invoking docker:package. My terminal is destroyed beyond repair by the binary output.

In my case, I am ADDing a binary/WAR file when invoking docker:package
version: Apache Maven 3.2.2
plugin version: 1.3.0

Workaround: redirect maven output to a file.

@rkrzewski
Copy link
Author

@hanswesterbeek you can salvage your terminal when that happens by pressing ^C and then running reset command

@hanswesterbeek
Copy link

@rkrzewski thanks :) i'll try... I am on a mac, doesn't seem to work... In any case, redirecting works for me even if it's troublesome

@alexec
Copy link
Owner

alexec commented Jul 22, 2014

Hi, can you give me output of mvn -version, and the OS you're working on?

@rkrzewski
Copy link
Author

Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T18:37:52+01:00)
Maven home: /home/rafal/opt/apache-maven-3.2.1
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle-1.7.0.51/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-32-generic", arch: "amd64", family: "unix"

@hanswesterbeek
Copy link

Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T15:51:42+02:00)
Maven home: /usr/local/Cellar/maven/3.2.2/libexec
Java version: 1.7.0_45, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.9.4", arch: "x86_64", family: "mac"

@alexec alexec added this to the 1.3.1 milestone Jul 22, 2014
@alexec alexec added the bug label Jul 22, 2014
@alexec alexec self-assigned this Jul 22, 2014
@alexec
Copy link
Owner

alexec commented Jul 22, 2014

thanks guys, fixed in 1.3.1-SNAPSHOT, I'll try to deploy to Nexus for testing later today.

@JaysonRaymond
Copy link

Any chance you can push this out? I'm experiencing the same problem on 1.3.0 using MacOSX Boot2Docker with Maven 3.1.1.

Thanks for this plugin!

@alexec
Copy link
Owner

alexec commented Jul 29, 2014

Released in v1.3.1

@alexec alexec closed this as completed Jul 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants