我正在使用 spotify 创建 docker 图像。我的 docker 镜像创建成功,但没有 oa 名称。我在控制台下面:
图像将在没有名称的情况下构建
POM文件
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.8.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.nv</groupId>
<artifactId>microeurekaserver</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>MicroEurekaServer</name>
<description>Eureka Server</description>
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.SR2</spring-cloud.version>
<docker.image.prefix>nvarshney44/nvarshney</docker.image.prefix>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
<forceTags>true</forceTags>
<imageTags>
<imageTag>${project.version}</imageTag>
<imageTag>latest</imageTag>
</imageTags>
<resources>
<resource>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
<serverId>docker-hub</serverId>
<registryUrl>https://index.docker.io/v1/</registryUrl>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
请帮我看看它有什么问题。在 maven 输出中,它显示 dockerfile:null 可能是因为它正在花费一些问题。
docker spring-boot spotify-docker-client docker-maven-plugin
如果某些内部列表属性值不满足条件,如何从列表中删除元素。这里的技巧是该属性本身是一个列表,比较基于该内部列表的某些属性。请参考以下示例并帮助填写代码中的注释部分:
目的 :
Class product{
private String productId;
private String productName;
private List<Attribute> attributeList;
public static class Attribute{
private Long attributeId;
}
}
Run Code Online (Sandbox Code Playgroud)
驱动程序类:
Class Driver{
List<product> productList = new ArrayList<product>();
/*
Remove the object from productList if attributeList doesn't contain attribute with attributeId = x;
*/
}
Run Code Online (Sandbox Code Playgroud)