Created
February 21, 2022 20:48
-
-
Save hoogenm/363fa6abfe4796ef6933ff4b113e52dc to your computer and use it in GitHub Desktop.
Docker Image to ContainerD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d2c() { | |
docker save "$1" | ctr image import - | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage, to copy image tagged
mycompany/mycontainer:v3
from local(ly built) Docker image to local ContainerD images:To then use the image in a Kubernetes yaml definition without pulling from registry, use the (same) tag, and
imagePullPolicy: Never
. Withkubectl run
use--image-pull-policy=Never
to prevent pulling from registry.For Kubernetes, works on local node only (i.e. only when pod is scheduled on the same node where d2c was executed, e.g. single node, or force scheduling of pod on same node, or have d2c executed on multiple nodes).