首页 > 其他分享 >Docker - ERROR: failed to solve: golang:latest: error getting credentials - err: exec: "docker-

Docker - ERROR: failed to solve: golang:latest: error getting credentials - err: exec: "docker-

时间:2023-09-23 17:58:15浏览次数:47  
标签:load credential executable 0.0 golang internal PATH docker latest

Dockerfile:

FROM golang:latest
WORKDIR /app
ADD . .
RUN go env -w GOPROXY=https://goproxy.io,direct
RUN go get
RUN go build -o app .
CMD ["/app/app"]

 

zzh@ZZHPC:/zdata/MyPrograms/Go/aaa$ docker build -t test:v1 .
[+] Building 1.3s (3/3) FINISHED                                                                    docker:default
 => [internal] load .dockerignore                                                                             0.0s
 => => transferring context: 2B                                                                               0.0s
 => [internal] load build definition from Dockerfile                                                          0.0s
 => => transferring dockerfile: 126B                                                                          0.0s
 => ERROR [internal] load metadata for docker.io/library/golang:latest                                        1.3s
------
 > [internal] load metadata for docker.io/library/golang:latest:
------
Dockerfile:1
--------------------
   1 | >>> FROM golang:latest
   2 |     WORKDIR /app
   3 |     ADD . .
--------------------
ERROR: failed to solve: golang:latest: error getting credentials - err: exec: "docker-credential-desktop": executable file not found in $PATH, out: ``

 

This is because I only installed docker in my Ubuntu and don't have docker desktop.

Deleting below line

"credsStore": "desktop",

from ~/.docker/config.json can fix this issue.

zzh@ZZHPC:/zdata/MyPrograms/Go/aaa$ docker build -t test:v1 .
[+] Building 11.4s (11/11) FINISHED                                                                                                                     docker:default
 => [internal] load build definition from Dockerfile                                                                                                              0.0s
 => => transferring dockerfile: 176B                                                                                                                              0.0s
 => [internal] load .dockerignore                                                                                                                                 0.0s
 => => transferring context: 2B                                                                                                                                   0.0s
 => [internal] load metadata for docker.io/library/golang:latest                                                                                                  2.6s
 => [1/6] FROM docker.io/library/golang:latest@sha256:c416ceeec1cdf037b80baef1ccb402c230ab83a9134b34c0902c542eb4539c82                                            0.0s
 => [internal] load build context                                                                                                                                 0.0s
 => => transferring context: 254B                                                                                                                                 0.0s
 => CACHED [2/6] WORKDIR /app                                                                                                                                     0.0s
 => [3/6] ADD . .                                                                                                                                                 0.0s
 => [4/6] RUN go env -w GOPROXY=https://goproxy.io,direct                                                                                                         0.2s
 => [5/6] RUN go get                                                                                                                                              2.0s
 => [6/6] RUN go build -o app .                                                                                                                                   6.3s
 => exporting to image                                                                                                                                            0.3s
 => => exporting layers                                                                                                                                           0.3s
 => => writing image sha256:f42bb07f7315ebe8c1637fd56cef227ab658f4f9455b34e82104e7d1e8ae7cd0                                                                      0.0s
 => => naming to docker.io/library/test:v1                                                                                                                        0.0s

 

标签:load,credential,executable,0.0,golang,internal,PATH,docker,latest
From: https://www.cnblogs.com/zhangzhihui/p/17724810.html

相关文章

  • XPATH&CSS规则
    css定位规则 css定位示例 xpath定位规则  xpath定位示例 ......
  • [ABC309Ex] Simple Path Counting Problem
    ProblemStatementWehaveagridwith$N$rowsand$M$columns.Wedenoteby$(i,j)$thecellinthe$i$-throwfromthetopand$j$-thcolumnfromtheleft.Youaregivenintegersequences$A=(A_1,A_2,\dots,A_K)$and$B=(B_1,B_2,\dots,B_L)$oflengths......
  • 2023-09-22 uniapp之canvas调用api【uni.canvasToTempFilePath】报错返回:canvasToTemp
    canvasToTempFilePath:失败-失败画布为空一般的解决方案就是查看uni.canvasToTempFilePath的传参是否正确,一个是canvasId必须正确,另一个就是第二个参数为this;但事情显示没那么简单,这二者我都有填写,却仍旧报这个错,我把canvasid换成别的,最后我想起了一件事情,就是canvas为空是因为......
  • import引用自定义包、模块sys.path.append() ---转
    https://blog.csdn.net/Frank_LJiang/article/details/122656604import引用自定义包、模块)sys.path.append(问题sys.path.append()os.path.dirname(__file__)问题当引用不同文件下的自定义包时,容易出现以下问题ModuleNotFoundError:Nomodulenamed'ge'由于importxxx时,默认情......
  • 题解 P9019 [USACO23JAN] Tractor Paths P
    显然,对于给定的\(l,r\),最短路可以贪心求出,即每次走与当前区间相交且左端点最大的区间,这个可以用倍增加速。定义\(f_{i,j}\)表示从区间\(i\)往右走\(j\)步后到达的区间,\(g_{i,j}\)表示往左走的情况。正反遍历一下即可求出\(f_{i,1}\)和\(g_{i,1}\)。对于第二问,第\(i......
  • 进程注入之Portable Executable Injection,PE注入的核心是创建远程线程,注意重定位表修
     PE(Portable Executable)注入是一种常见的代码注入技术,主要用于在目标进程中执行恶意代码。以下是PE注入的基本流程:1. 获取当前PE映像的基地址:使用GetModuleHandle(NULL)函数获取当前PE映像(即要注入的代码)的基地址。2. 复制PE映像:使用VirtualAlloc函数在当前进程中分配一块新......
  • win10 uwp 简单制作一个 Path 路径绘制的图标按钮
    本文告诉大家在UWP或WinUI3里面如何简单制作一个由Path几何路径图形绘制的图标按钮先在资源里面定义按钮的样式,重写Template属性,通过在Template里面放入Path绑定Data到内容从而实现让Path显示集合路径图形,代码如下<Stylex:Key="Style.TitlebarButton"......
  • systemd path:实时监控文件和目录的变动
    回到Systemd系列文章大纲systemdpath:实时监控文件和目录的变动systemdpath工具提供了监控文件、目录变化并触发执行指定操作的功能。有时候这种监控功能是非常实用的,比如监控到/etc/nginx/nginx.conf或/etc/nginx/conf.d/发生变化后,立即reloadnginx。虽然,用户也可以使用in......
  • class path resource [.xml] cannot be opened because it does not exist
    classpathresource[bean1.xml]cannotbeopenedbecauseitdoesnotexist错误重现bug:Exceptioninthread"main"org.springframework.beans.factory.BeanDefinitionStoreException:IOExceptionparsingXMLdocumentfromclasspathresource[bean1.xml]......
  • java 运行 jar classpath配置
    按照developrworks上说的: http://www.ibm.com/developerworks/cn/java/j-jar/index.html 创建可执行JAR创建一个可执行JAR很容易。首先将所有应用程序代码放到一个目录中。假设应用程序中的主类是 com.mycompany.myapp.Sample。您要创建一个包含应用程序代码的JAR文件并标......