簡體   English   中英

如何使用帶有 tls 的 localhost 注冊表的 buildctl

[英]How to use buildctl with localhost registry with tls

我正在嘗試將 buildctl 工具與在我的本地主機上運行的 Artifactory 注冊表一起使用。

我正在使用以下命令。

buildctl build \
--frontend=dockerfile.v0 \
--local context=. \
--local dockerfile=. \
--output type=image,name=192.168.0.110:8082/docker-local/test,push=true,registry.insecure=true \
--export-cache type=registry,ref=192.168.0.110:8082/docker-local/test,mode=max,push=true,registry.insecure=true \
--import-cache type=registry,ref=192.168.0.110:8082/docker-local/test,registry.insecure=true 

如文檔中所述,我添加了標志“registry.insecure=true”。 但是,仍然出現以下錯誤:

> exporting content cache:
------
error: failed to solve: error writing layer blob: failed to do request: Head "https://192.168.0.110:8082/v2/docker-local/test/blobs/sha256:03d1cdba14f373b9dbca6b5fe65f8eca1e9852aaaf9060450b27f924a56a1b3c": remote error: tls: unrecognized name

似乎它正試圖通過 HTTPS 訪問本地倉庫。

如何讓它與 HTTP 一起使用?

使用版本:buildctl github.com/moby/buildkit 0.11.1

buildkit 守護進程需要使用指定注冊表為 http 而不是 https 的配置文件運行。請參閱 buildkitd.toml 上的文檔

[registry."192.168.0.110:8082"]
  http = true

對於 rootful 模式,文件路徑為/etc/buildkit/buildkitd.toml ,對於 rootless 模式,文件路徑為~/.config/buildkit/buildkitd.toml

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM