JIB docker hub映像推送失败com.fasterxml.jackson.core.JsonParseException:意外字符(“ <”(代码60)):预期为有效值

时间:2019-02-22 02:40:40

标签: docker jib

我正在尝试使用臂架构建docker映像。这里是注册表配置。

jib {
    to {
        image = 'docker.io/sfgroups/webappjib'
        auth {
            username = dockerUsername
            password = dockerPassword
        }
    }
    container {
        jvmFlags = ['-Djava.security.egd=file:/dev/./urandom', '-Duser.timezone=GMT+08', '-Xdebug']
        mainClass ="webapp.Application"
        args = ['some args']
        ports = ['8080']
        labels = [key1:'value1', key2:'value2']

    }
}

当我运行gradle jib并给出以下错误消息时。

[===================           ] 62.5% complete
> pushing blob sha256:a9ab09c58ac2675c2540211a9...
> pushing blob sha256:7b4602f44db208190163add5d...
> pushing blob sha256:b94e0ff719209f5b24e42cae8...
> pushing blob sha256:60e1b8ab9d1d02dc50650b08a...
> pushing blob sha256:3e010093287c245d72a774033...
> pushing blob sha256:d5e5fdbdea046cdcc0781103d...
> pushing blob sha256:c242ad6bb707a5b3bca846c40...

> Task :jib FAILED
Got more than one input Future failure. Logging failures after the first
com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: (StringReader); line: 2, column: 2]
        at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1804)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:693)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:591)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1902)
        at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:757)
        at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4141)
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4000)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3004)
        at com.google.cloud.tools.jib.json.JsonTemplateMapper.readJson(JsonTemplateMapper.java:101)
        at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call(RegistryEndpointCaller.java:248)
        at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.callWithAllowInsecureRegistryHandling(RegistryEndpointCaller.java:152)
        at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call(RegistryEndpointCaller.java:142)
        at com.google.cloud.tools.jib.registry.RegistryClient.callRegistryEndpoint(RegistryClient.java:356)
        at com.google.cloud.tools.jib.registry.RegistryClient.pushBlob(RegistryClient.java:304)
        at com.google.cloud.tools.jib.builder.steps.PushBlobStep.call(PushBlobStep.java:118)
        at com.google.cloud.tools.jib.builder.steps.PushBlobStep.call(PushBlobStep.java:39)
        at com.google.common.util.concurrent.CombinedFuture$CallableInterruptibleTask.runInterruptibly(CombinedFuture.java:181)
        at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)
Got more than one input Future failure. Logging failures after the first
com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: (StringReader); line: 2, column: 2]
        at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1804)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:693)
        at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:591)

如何解决此错误消息?

谢谢 SR

2 个答案:

答案 0 :(得分:1)

registry.hub.docker.com添加到图像标签即可解决此问题。

jib {  
    to {
        image = 'registry.hub.docker.com/sfgroups/webappjib'
        auth {
            username = dockerUsername
            password = dockerPassword
        }
    }
    container {
        jvmFlags = ['-Djava.security.egd=file:/dev/./urandom', '-Duser.timezone=GMT+08', '-Xdebug']        
        args = ['some args']
        ports = ['8080']
        labels = [key1: 'value1', key2: 'value2']

    }
    allowInsecureRegistries = true

}

答案 1 :(得分:0)

我打算把这个留在这里,因为我从今天起就遇到了这个问题。 对我来说,解决方案是将 Jib 从 1.0.0 版升级到 1.8.0 版