Skip to content

Commit 2641fe8

Browse files
vpavicwilkinsona
authored andcommitted
Tag Docker images created by launch script integration tests
Closes gh-5168
1 parent b061aa5 commit 2641fe8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

spring-boot-integration-tests/spring-boot-launch-script-tests/README.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,12 @@ $ mvn -Pdocker clean verify
6565
The first time the tests are run, Docker will create the container images that are used to
6666
run the tests. This can take several minutes, particularly if you have a slow network
6767
connection. Subsequent runs will be faster as the images are cached locally. You can run
68-
`docker images` to see a list of the cached images.
68+
`docker images` to see a list of the cached images. Images created by these tests will be
69+
tagged with `spring-boot-it` prefix to easily distinguish them.
6970

7071
== Cleaning up
7172

7273
If you want to reclaim the disk space used by the cached images (at the expense of having
7374
to wait for them to be downloaded and rebuilt the next time you run the tests), you can
74-
use `docker images` to list the images and `docker rmi <image>` to delete them. See
75-
`docker rmi --help` for further details.
75+
use `docker images` to list the images and `docker rmi <image>` to delete them (look for
76+
`spring-boot-it` tag). See `docker rmi --help` for further details.

spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ private String buildImage(DockerClient docker) {
243243
BuildImageResultCallback resultCallback = new BuildImageResultCallback();
244244
String dockerfile = "src/test/resources/conf/" + this.os + "/" + this.version
245245
+ "/Dockerfile";
246-
docker.buildImageCmd(new File(dockerfile)).exec(resultCallback);
246+
String tag = "spring-boot-it/" + this.os.toLowerCase() + ":" + this.version;
247+
docker.buildImageCmd(new File(dockerfile)).withTag(tag).exec(resultCallback);
247248
String imageId = resultCallback.awaitImageId();
248249
return imageId;
249250
}

0 commit comments

Comments
 (0)