PageSourceSearch

https://docs.rancherdesktop.io/assets/js/cc3d2bf0.20476114.js

js rancherdesktop.io collected 2026-09-24 15:24:54 UTC 9,466 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkdocs_rancherdesktop_io=self.webpackChunkdocs_rancherdesktop_io||[]).push([[12810],{28453:(e,n,s)=>{s.d(n,{R:()=>r,x:()=>a});var o=s(96540);const i={},t=o.createContext(i);function r(e){const n=o.useContext(t);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),o.createElement(t.Provider,{value:n},e.children)}},31897:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>r,metadata:()=>o,toc:()=>c});const o=JSON.parse('{"id":"how-to-guides/transfer-container-images","title":"Transfer Container Images","description":"Rancher Desktop provides dockerd and containerd as container engine options to manage containers. There are occasions when you might want to transfer the images from one container engine environment to the other. Or you may have migrated to Rancher Desktop from a different container management application and might want to bring the local images from the previous application environment to the Rancher Desktop environment.  This guide provides steps to transfer images using the save and load commands.","source":"@site/versioned_docs/version-1.12/how-to-guides/transfer-container-images.md","sourceDirName":"how-to-guides","slug":"/how-to-guides/transfer-container-images","permalink":"/1.12/how-to-guides/transfer-container-images","draft":false,"unlisted":false,"tags":[],"version":"1.12","frontMatter":{"title":"Transfer Container Images"},"sidebar":"tutorialSidebar","previous":{"title":"Installing and Uninstalling Rancher Desktop Extensions","permalink":"/1.12/how-to-guides/installing-uninstalling-extensions"},"next":{"title":"Create a Multi-Node Cluster with k3d","permalink":"/1.12/how-to-guides/create-multi-node-cluster"}}');var i=s(74848),t=s(28453);const r={title:"Transfer Container Images"},a=void 0,l={},c=[{value:"Steps",id:"steps",level:3}];function d(e){const n={a:"a",code:"code",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.R)(),...e.components},{TabItem:s,Tabs:o}=n;return s||m("TabItem",!0),o||m("Tabs",!0),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["Rancher Desktop provides ",(0,i.jsx)(n.code,{children:"dockerd"})," and ",(0,i.jsx)(n.code,{children:"containerd"})," as container engine options to manage containers. There are occasions when you might want to transfer the images from one container engine environment to the other. Or you may have migrated to Rancher Desktop from a different container management application and might want to bring the local images from the previous application environment to the Rancher Desktop environment.  This guide provides steps to transfer images using the ",(0,i.jsx)(n.code,{children:"save"})," and ",(0,i.jsx)(n.code,{children:"load"})," commands."]}),"\n",(0,i.jsx)(n.h3,{id:"steps",children:"Steps"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"1. Save image(s) from the source environment to a tar archive."})}),"\n",(0,i.jsxs)(o,{groupId:"container-runtime",children:[(0,i.jsxs)(s,{value:"nerdctl",default:!0,children:[(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Save a single image"}),"\n"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"nerdctl save -o local-image.tar image:tag\n"})}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Save multiple images"}),"\n"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"nerdctl save -o local-images.tar image1:tag1 image2:tag2\n"})}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Save all images in a namespace"}),"\n"]}),(0,i.jsxs)(n.p,{children:["Below two commands use ",(0,i.jsx)(n.a,{href:"https://stedolan.github.io/jq/",children:"jq"})," for JSON parsing. The long command performs the below steps:"]}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["The ",(0,i.jsx)(n.code,{children:"nerdctl -n k8s.io image ls"})," sub command gets the list of all images present in the ",(0,i.jsx)(n.code,{children:"k8s.io"})," namespace, hence doesn't include images from any other namespace, ",(0,i.jsx)(n.code,{children:"default"})," for instance."]}),"\n",(0,i.jsxs)(n.li,{children:["The ",(0,i.jsx)(n.code,{children:"jq"})," sub command filters and formats the images list from the previous step.","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["The ",(0,i.jsx)(n.code,{children:'select(.Repository!=\\"<none>\\")'})," part of the command skips those images with repository having a value of ",(0,i.jsx)(n.code,{children:"<none>"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:["The ",(0,i.jsx)(n.code,{children:'if (.Tag=="<none>") then .Repository else (.Repository+":"+.Tag) end\')'})," part of the command formats the name of the images to be just the ",(0,i.jsx)(n.code,{children:"<Repository>"})," or ",(0,i.jsx)(n.code,{children:"<Repository>:<Tag>"})," depending on whether a image tag has a value of ",(0,i.jsx)(n.code,{children:"<none>"})," or not."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["Finally the ",(0,i.jsx)(n.code,{children:"nerdctl -n k8s.io save -o all-local-images-in-namespace.tar"})," part of the command saves the filtered and formatted images list from the previous two steps into a tar file."]}),"\n"]}),(0,i.jsxs)(o,{groupId:"shell",children:[(0,i.jsx)(s,{value:"Bash",default:!0,children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:'nerdctl -n k8s.io save -o all-local-images-in-namespace.tar $(nerdctl -n k8s.io image ls --format \'{{json .}}\' | jq -r \'select(.Repository!="<none>") | if (.Tag=="<none>") then .Repository else (.Repository+":"+.Tag) end\')\n'})})}),(0,i.jsx)(s,{value:"PowerShell",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:'nerdctl -n k8s.io save -o all-local-images-in-namespace.tar $(nerdctl -n k8s.io image ls --format \'{{json .}}\' | jq -r \'select(.Repository!=\\"<none>\\") | if (.Tag==\\"<none>\\") then .Repository else (.Repository+\\":\\"+.Tag) end\')\n'})})})]})]}),(0,i.jsxs)(s,{value:"docker",children:[(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Save a single image"}),"\n"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"docker save -o local-image.tar image:tag\n"})}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Save multiple images"}),"\n"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"docker save -o local-images.tar image1:tag1 image2:tag2\n"})}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Save all local images"}),"\n"]}),(0,i.jsxs)(n.p,{children:["Below two commands use ",(0,i.jsx)(n.a,{href:"https://stedolan.github.io/jq/",children:"jq"})," for JSON parsing. The long command performs the below steps:"]}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["The ",(0,i.jsx)(n.code,{children:"docker image ls"})," sub command gets the list of all local images."]}),"\n",(0,i.jsxs)(n.li,{children:["The ",(0,i.jsx)(n.code,{children:"jq"})," sub command filters and formats the images list from the previous step.","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["The ",(0,i.jsx)(n.code,{children:'select(.Repository!=\\"<none>\\")'})," part of the command skips those images with repository having a value of ",(0,i.jsx)(n.code,{children:"<none>"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:["The ",(0,i.jsx)(n.code,{children:'if (.Tag=="<none>") then .Repository else (.Repository+":"+.Tag) end\')'})," part of the command formats the name of the images to be just the ",(0,i.jsx)(n.code,{children:"<Repository>"})," or ",(0,i.jsx)(n.code,{children:"<Repository>:<Tag>"})," depending on whether a image tag has a value of ",(0,i.jsx)(n.code,{children:"<none>"})," or not."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["Finally the ",(0,i.jsx)(n.code,{children:"docker save -o all-local-images-in-namespace.tar"})," part of the command saves the filtered and formatted images list from the previous two steps into a tar file."]}),"\n"]}),(0,i.jsxs)(o,{groupId:"shell",children:[(0,i.jsx)(s,{value:"Bash",default:!0,children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:'docker save -o all-local-images-in-namespace.tar $(docker image ls --format \'{{json .}}\' | jq -r \'select(.Repository!="<none>") | if (.Tag=="<none>") then .Repository else (.Repository+":"+.Tag) end\')\n'})})}),(0,i.jsx)(s,{value:"PowerShell",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:'docker save -o all-local-images-in-namespace.tar $(docker image ls --format \'{{json .}}\' | jq -r \'select(.Repository!=\\"<none>\\") | if (.Tag==\\"<none>\\") then .Repository else (.Repository+\\":\\"+.Tag) end\')\n'})})})]})]})]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"2. Load images from the saved tar archive in the target environment."})}),"\n",(0,i.jsxs)(o,{groupId:"container-runtime",children:[(0,i.jsx)(s,{value:"nerdctl",default:!0,children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"nerdctl load < local-images.tar\n"})})}),(0,i.jsx)(s,{value:"docker",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"docker load -i local-images.tar\n"})})})]})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}function m(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.