2

我正在尝试通过从其 git 存储库中克隆它来构建docker 的 Java API ,然后使用 maven 构建,如下所示:

mvn clean install -DskipTests=false -Ddocker.io.username=username -Ddocker.io.password=password -Ddocker.io.email=my@email.id

但是,构建测试失败,导致以下错误消息:

Results :

Failed tests: 
  testRunShlex(com.github.dockerjava.client.DockerClientTest): busybox is an unrecognized image. Please pull the image first.
  testAuth(com.github.dockerjava.client.command.AuthCmdTest): com.sun.jersey.api.client.UniformInterfaceException: Client response status: 404
  testAuthInvalid(com.github.dockerjava.client.command.AuthCmdTest): expected:<401> but was:<404>
  testAddAndCopySubstitution(com.github.dockerjava.client.command.BuildImageCmdTest): 
  testDockerBuilderAddFileInSubfolder(com.github.dockerjava.client.command.BuildImageCmdTest): 
  testDockerBuilderAddFolder(com.github.dockerjava.client.command.BuildImageCmdTest): 
  testDockerBuilderAddUrl(com.github.dockerjava.client.command.BuildImageCmdTest): 
  testNetCatDockerfileBuilder(com.github.dockerjava.client.command.BuildImageCmdTest): 
  testNginxDockerfileBuilder(com.github.dockerjava.client.command.BuildImageCmdTest): 
  commit(com.github.dockerjava.client.command.CommitCmdTest): busybox is an unrecognized image. Please pull the image first.
  testDiff(com.github.dockerjava.client.command.ContainerDiffCmdTest): busybox is an unrecognized image. Please pull the image first.
  copyFromContainer(com.github.dockerjava.client.command.CopyFileFromContainerCmdTest): busybox is an unrecognized image. Please pull the image first.
  createContainerWithEnv(com.github.dockerjava.client.command.CreateContainerCmdTest): busybox is an unrecognized image. Please pull the image first.
  createContainerWithHostname(com.github.dockerjava.client.command.CreateContainerCmdTest): busybox is an unrecognized image. Please pull the image first.
  createContainerWithVolume(com.github.dockerjava.client.command.CreateContainerCmdTest): busybox is an unrecognized image. Please pull the image first.
  info(com.github.dockerjava.client.command.InfoCmdTest): busybox is an unrecognized image. Please pull the image first.
  testKillContainer(com.github.dockerjava.client.command.KillContainerCmdTest): busybox is an unrecognized image. Please pull the image first.
  testListContainers(com.github.dockerjava.client.command.ListContainersCmdTest): Client response status: 404
  listImages(com.github.dockerjava.client.command.ListImagesCmdTest)
  logContainer(com.github.dockerjava.client.command.LogContainerCmdTest): busybox is an unrecognized image. Please pull the image first.
  testPullImage(com.github.dockerjava.client.command.PullImageCmdTest): com.sun.jersey.api.client.UniformInterfaceException: Client response status: 404
  testNotExistentImage(com.github.dockerjava.client.command.PushImageCmdTest): 
  testPushLatest(com.github.dockerjava.client.command.PushImageCmdTest): busybox is an unrecognized image. Please pull the image first.
  removeContainer(com.github.dockerjava.client.command.RemoveContainerCmdTest): busybox is an unrecognized image. Please pull the image first.
  testRemoveImage(com.github.dockerjava.client.command.RemoveImageCmdTest): busybox is an unrecognized image. Please pull the image first.
  restartContainer(com.github.dockerjava.client.command.RestartContainerCmdTest): busybox is an unrecognized image. Please pull the image first.
  searchImages(com.github.dockerjava.client.command.SearchImagesCmdTest): com.sun.jersey.api.client.UniformInterfaceException: Client response status: 404
  startContainer(com.github.dockerjava.client.command.StartContainerCmdTest): busybox is an unrecognized image. Please pull the image first.
  startContainerWithLinking(com.github.dockerjava.client.command.StartContainerCmdTest): busybox is an unrecognized image. Please pull the image first.
  startContainerWithPortBindings(com.github.dockerjava.client.command.StartContainerCmdTest): busybox is an unrecognized image. Please pull the image first.
  startContainerWithVolumes(com.github.dockerjava.client.command.StartContainerCmdTest): busybox is an unrecognized image. Please pull the image first.
  testStopContainer(com.github.dockerjava.client.command.StopContainerCmdTest): busybox is an unrecognized image. Please pull the image first.
  testTagImage(com.github.dockerjava.client.command.TagImageCmdTest): 
  version(com.github.dockerjava.client.command.VersionCmdTest): com.sun.jersey.api.client.UniformInterfaceException: Client response status: 404
  testWaitContainer(com.github.dockerjava.client.command.WaitContainerCmdTest): busybox is an unrecognized image. Please pull the image first.

Tests run: 35, Failures: 35, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.

在此处粘贴完整的输出。

我尝试使用以下方法从 docker hub 提取busybox 图像:

sudo docker pull busybox

它会导致以下消息:

Pulling repository busybox
fd5373b3d938: Download complete 
d200959a3e91: Download complete 
37fca75d01ff: Download complete 
a9eb17255234: Download complete 
511136ea3c5a: Download complete 
42eed7f1bf2a: Download complete 
120e218dd395: Download complete 
f06b02872d52: Download complete 
c120b7cab0b0: Download complete 
1f5049b3536e: Download complete 

我假设成功下载了busybox图像。但是,尝试重建 Java API 会导致相同的错误消息。

如何解决此问题并成功构建 Java API?


系统规格:

主机:Ubuntu 14.04 Trusty Tahr LTS

的输出sudo docker version

Client version: 0.9.1
Go version (client): go1.2.1
Git commit (client): 3600720
Server version: 0.9.1
Git commit (server): 3600720
Go version (server): go1.2.1
Last stable version: 1.1.2, please update docker
4

1 回答 1

1

java API 配置为使用 Docker 1.1 运行,尝试更新 Docker。

Docker 的 Java API 客户端

支持 Docker Client API v1.13 的子集,Docker Server 版本 1.1

docker-java 开发者论坛

查看官方网站上的说明:https ://docs.docker.com/installation/ubuntulinux/#ubuntu-trusty-1404-lts-64-bit

确保您有用于开发的 openjdk。

sudo apt-get install openjdk-7-jdk

然后将您的 JAVA_HOME 环境变量更改为指向/usr/lib/jvm/java-7-openjdk-amd64/

您正在使用不是为此目的而制作的 JRE,而且似乎有问题。

于 2014-08-19T13:34:20.917 回答