spotify dockerfile-maven-plugin ‘Could not acquire image ID or digest following build’错误解决
spotify dockerfile-maven-plugin ‘Could not acquire image ID or digest following build’错误解决
背景
使用spotify dockerfile-maven-plugin 在使用maven编译项目的过程中自动构建docker镜像文件,在构建过程中遇到“Could not acquire image ID or digest following build”错误,无法定位错误原因,全网检索以后,发现部分网友也遇到过,网友提出的错误原因有:
[ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.12:build (default) on project engine: Execution default of goal com.spotify:dockerfile-maven-plugin:1.4.12:build failed: Could not acquire image ID or digest following build -> [Help 1]
[ERROR] pull access denied for hksanduo/oracle-jdk-8, repository does not exist or may require 'docker login': denied: requested access to the resource is denied [WARNING] An attempt failed, will retry 1 more times org.apache.maven.plugin.MojoExecutionException: Could not build image at com.spotify.plugin.dockerfile.BuildMojo.buildImage (BuildMojo.java:247) at com.spotify.plugin.dockerfile.BuildMojo.execute (BuildMojo.java:135) at com.spotify.plugin.dockerfile.AbstractDockerMojo.tryExecute (AbstractDockerMojo.java:265) at com.spotify.plugin.dockerfile.AbstractDockerMojo.execute (AbstractDockerMojo.java:254) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293) at org.apache.maven.cli.MavenCli.main (MavenCli.java:196) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: com.spotify.docker.client.exceptions.DockerException: pull access denied for hksanduo/oracle-jdk-8, repository does not exist or may require 'docker login': denied: requested access to the resource is denied