我想将 docker 映像推送到在 rke2 中运行的本地注册表。
CTR_PUSH_CMD = (
"/var/lib/rancher/rke2/bin/ctr "
"-a /run/k3s/containerd/containerd.sock -n k8s.io images "
)
reg_usr = "user"
reg_pass = "****"
filtered_images_list = ["images.."]
for image_name in filtered_images_list:
LOGGER.debug("======================================================")
push_cmd = (
CTR_PUSH_CMD
+ " push --plain-http=true --platform linux/amd64 "
+ image_name
)
if reg_usr and reg_pass:
push_cmd += " -u " + reg_usr + ":" + reg_pass
push_response = command_execution.execute(push_cmd)
LOGGER.debug("Image push result: %s", push_response)
LOGGER.debug("======================================================")
我收到以下错误:
CRITICAL ctr: failed to copy: rpc error: code = Internal desc = unexpected EOF
代码能够在 nut 之前推送到注册表,现在我收到此错误。我没有更改代码中的任何内容。