Skip to content

Commit

Permalink
add test for arm64 image
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeddada1 committed Jun 7, 2024
1 parent f2d886b commit 9ff90bd
Showing 1 changed file with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,39 @@ public void testBasic_jibImageToDockerDaemon()
Assert.assertEquals("Hello World\n", output);
}

@Test
public void testBasic_jibImageToDockerDaemon_arm64()
throws IOException, InterruptedException, InvalidImageReferenceException, ExecutionException,
RegistryException, CacheDirectoryCreationException {
Jib.from(
RegistryImage.named(
"busybox@sha256:eb427d855f82782c110b48b9a398556c629ce4951ae252c6f6751a136e194668"))
.containerize(
Containerizer.to(
DockerDaemonImage.named(dockerHost + ":5000/docker-daemon-mismatched-arch")));

String os =
new Command(
"docker",
"inspect",
dockerHost + ":5000/docker-daemon-mismatched-arch",
"--format",
"{{.Os}}")
.run()
.replace("\n", "");
String architecture =
new Command(
"docker",
"inspect",
dockerHost + ":5000/docker-daemon-mismatched-arch",
"--format",
"{{.Architecture}}")
.run()
.replace("\n", "");
assertThat(os).isEqualTo("linux");
assertThat(architecture).isEqualTo("arm64");
}

@Test
public void testBasicMultiPlatform_toDockerDaemon()
throws IOException, InterruptedException, ExecutionException, RegistryException,
Expand Down Expand Up @@ -349,7 +382,6 @@ public void testBasicMultiPlatform_toDockerDaemon_pickFirstPlatformWhenNoMatchin
RegistryImage.named(
"busybox@sha256:4f47c01fa91355af2865ac10fef5bf6ec9c7f42ad2321377c21e844427972977"))
.setPlatforms(ImmutableSet.of(new Platform("s390x", "linux"), new Platform("arm", "linux")))
.setEntrypoint("echo", "Hello World")
.containerize(
Containerizer.to(
DockerDaemonImage.named(dockerHost + ":5000/docker-daemon-multi-platform"))
Expand Down

0 comments on commit 9ff90bd

Please sign in to comment.