Docker的Azure管道错误“客户端版本1.18太旧。支持的最低API版本是1.24”

时间:2019-06-17 02:13:44

标签: azure-devops azure-pipelines azure-pipelines-build-task

我正在使用以下mvn docker配置文件在azure上运行构建管道。

                   <plugin>
                        <groupId>io.fabric8</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <version>0.25.2</version>
                        <configuration>
                         <configuration>
                            <dockerHost>${docker.host}</dockerHost>
                            <images>
                                <image>
                                    <alias>${project.artifactId}</alias>
                                    <name>inst-iot/${project.artifactId}:${project.version}</name>
                                    <build>
                                        <from>java:8-jdk-alpine</from>
                                        <assembly>
                                            <descriptorRef>artifact</descriptorRef>
                                        </assembly>
                                        <ports>
                                            <port>80</port>
                                        </ports>
                                        <env>
                                            <SERVER_PORT>80</SERVER_PORT>
                                            <JAVA_OPTS>-Xmx2048m</JAVA_OPTS>
                                        </env>
                                        <cmd>
                                            <shell>java $JAVA_OPTS -jar
                                                /maven/${project.name}-${project.version}.jar
                                                --spring.profiles.active=docker</shell>
                                        </cmd>
                                        <tags>
                                            <tag>latest</tag>
                                            <tag>${project.version}</tag>
                                        </tags>
                                    </build>
                                </image>
                            </images>
                        </configuration>

Hosted Windows 2019 with VS2019代理程序池上运行时,它会引发如下错误,

[ERROR] DOCKER> Unable to check image [openjdk:8] : client version 1.18 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version (Bad Request: 400) [client version 1.18 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version (Bad Request: 400)]

我认为这与代理计算机上的Docker版本有关。我该如何解决这个问题?

2 个答案:

答案 0 :(得分:0)

查看Alpine的当前OpenJDK图像,支持的JDK(用于Alpine)图像标签是:

  

标签:13-ea-19-jdk-alpine3.9,13-ea-19-alpine3.9,13-ea-jdk-alpine3.9,13-ea-alpine3.9,13-jdk-alpine3 .9、13-alpine3.9、13-ea-19-jdk-alpine,13-ea-19-alpine,13-ea-jdk-alpine,13-ea-alpine,13-jdk-alpine,13-alpine

此列表来自:https://github.com/docker-library/official-images/blob/8d9c213e6129df5858a85c8368515d90e737c1f8/library/openjdk#L13

并且图像8-jdk-alpine不再可用,因为它将不再受支持。

因此,您应该使用标签13-jdk-alpine,完整标签为openjdk:13-jdk-alpine

答案 1 :(得分:0)

也可以通过将docker-maven-plugin版本更改为0.30.0来解决