在the "Create Full Microservice Stack Using Jhipster Domain Language Under 30 Minutes" article之后,我跑步后遇到问题
./gradlew bootWar -Pprod jibDockerBuild (not the command mentioned in the article ./gradlew -Pprod bootWar buildDocker)
我收到以下错误:
Caused by: org.gradle.api.GradleException: Build to Docker daemon failed
andardTaskAction.java:46)
...
Caused by: java.io.IOException: 'docker load' command failed with error: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.29/images/load?quiet=1: dial unix /var/run/docker.sock: connect: permission denied
at com.google.cloud.tools.jib.docker.DockerClient.load(DockerClient.java:102)
at com.google.cloud.tools.jib.builder.steps.LoadDockerStep.afterPushBaseImageLayerFuturesFuture(LoadDockerStep.java:95)
at com.google.common.util.concurrent.CombinedFuture$CallableInterruptibleTask.runInterruptibly(CombinedFuture.java:181)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
Suppressed: java.io.IOException: Stream Closed
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:326)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at java.io.FilterOutputStream.close(FilterOutputStream.java:158)
at com.google.cloud.tools.jib.docker.DockerClient.$closeResource(DockerClient.java:104)
at com.google.cloud.tools.jib.docker.DockerClient.load(DockerClient.java:104)
at com.google.cloud.tools.jib.builder.steps.LoadDockerStep.afterPushBaseImageLayerFuturesFuture(LoadDockerStep.java:95)
at com.google.common.util.concurrent.CombinedFuture$CallableInterruptibleTask.runInterruptibly(CombinedFuture.java:181)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Broken pipe
at com.google.cloud.tools.jib.hash.CountingDigestOutputStream.write(CountingDigestOutputStream.java:83)
at org.apache.commons.compress.utils.CountingOutputStream.write(CountingOutputStream.java:48)
at org.apache.commons.compress.utils.FixedLengthBlockOutputStream$BufferAtATimeOutputChannel.write(FixedLengthBlockOutputStream.java:241)
at org.apache.commons.compress.utils.FixedLengthBlockOutputStream.writeBlock(FixedLengthBlockOutputStream.java:92)
at org.apache.commons.compress.utils.FixedLengthBlockOutputStream.maybeFlush(FixedLengthBlockOutputStream.java:86)
at org.apache.commons.compress.utils.FixedLengthBlockOutputStream.write(FixedLengthBlockOutputStream.java:122)
at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.write(TarArchiveOutputStream.java:452)
at com.google.cloud.tools.jib.hash.CountingDigestOutputStream.write(CountingDigestOutputStream.java:83)
at com.google.common.io.ByteStreams.copy(ByteStreams.java:110)
at com.google.cloud.tools.jib.blob.BlobDescriptor.fromPipe(BlobDescriptor.java:47)
at com.google.cloud.tools.jib.blob.FileBlob.writeTo(FileBlob.java:38)
at com.google.cloud.tools.jib.tar.TarStreamBuilder.writeEntriesAsTarArchive(TarStreamBuilder.java:51)
at com.google.cloud.tools.jib.blob.WriterBlob.writeTo(WriterBlob.java:36)
at com.google.cloud.tools.jib.docker.DockerClient.load(DockerClient.java:88)
... 3 more
Suppressed: java.io.IOException: This archive contains unclosed entries.
at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.finish(TarArchiveOutputStream.java:289)
at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.close(TarArchiveOutputStream.java:306)
at com.google.cloud.tools.jib.tar.TarStreamBuilder.writeEntriesAsTarArchive(TarStreamBuilder.java:54)
at com.google.cloud.tools.jib.blob.WriterBlob.writeTo(WriterBlob.java:36)
at com.google.cloud.tools.jib.docker.DockerClient.load(DockerClient.java:88)
at com.google.cloud.tools.jib.builder.steps.LoadDockerStep.afterPushBaseImageLayerFuturesFuture(LoadDockerStep.java:95)
at com.google.common.util.concurrent.CombinedFuture$CallableInterruptibleTask.runInterruptibly(CombinedFuture.java:181)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
我需要在DockerHub上设置一个帐户来解决此问题吗?如果是,如何在命令中传递我的帐户信息?
答案 0 :(得分:0)
我认为您的用户缺少docker组的权限,但是请注意,该组几乎像root用户一样。尝试使用sudo发送命令以获取访问PC上的 socket 的权限,这对我是否拥有docker acc都没关系