-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
docker inspect output parsing fails on Windows #2270
Comments
Ah, thanks. I initially thought this is only when the image is a Windows image, but you confirmed in #2215 (comment) that it is a general problem. So looks like anyone on Windows just cannot use a local Docker engine image. I know we have this code: jib/jib-core/src/main/java/com/google/cloud/tools/jib/filesystem/XdgDirectories.java Line 121 in 2e7b670
That of course requires String osName = properties.getProperty("os.name").toLowerCase(Locale.ENGLISH); |
Exactly! I've tested it with both Windows Containers and Linux Containers, and the error is still the same. |
Um, hold on. I think we may fix this using a different approach. |
Thanks! Is a nightly build with this change available? I would like to test it on Windows, maybe there is another issue, so we could move the Windows Containers support more quickly. |
@augi it's easy to build it yourself.
This will build 2.0.1-SNAPSHOT and install it into your local Maven repo ( buildscript {
repositories {
mavenLocal() // resolve in ~/.m2/repository
mavenCentral()
}
dependencies {
classpath 'com.google.cloud.tools:jib-gradle-plugin:2.0.1-SNAPSHOT'
}
}
// instead of using the `plugins` block, use `apply plugin`:
//plugins {
// id 'com.google.cloud.tools.jib' version '2.0.0'
//}
apply plugin: 'com.google.cloud.tools.jib'
... Thanks for testing this out! I'm curious too. |
@chanseokoh Please see #2288 - this is another issue with Windows Containers. Maybe the fix will be part of #1568 If I can help, just let me know. |
But at least, you can now load local Docker images on Windows! |
Environment:
Description of the issue:
Output from
docker inspect
is not valid JSON on Windows and so the parsing fails on following error:See also this report
The
docker inspect
is issued when using base Docker image from daemon (instead of from registry), see thedocker://
prefix below. It's possible thatdocker inspect
is used also in different use-cases.Expected behavior:
jib
doesn't fail on invalid JSON parsing, when running on Windows and using base image from Docker daemon.Steps to reproduce:
build.gradle
as shown below.jibDockerBuild
.jib-gradle-plugin
Configuration:Log output:
Additional Information:
The problem is in this method. If I tried to execute the command manually then I really got invalid JSON:
The solution is to use triple-doublequotes to ensure doublequotes are present in the output:
So IMHO the solution is to use slightly different command, based on current OS.
I'm willing to prepare a PR for this. It would be great if you suggested me the preferred way how to detect Windows OS.
The text was updated successfully, but these errors were encountered: