Skip to content

Instantly share code, notes, and snippets.

@Alceatraz
Created March 22, 2023 09:42
Show Gist options
  • Save Alceatraz/f80ea53d6971b6c6b772c8bafc1427ef to your computer and use it in GitHub Desktop.
Save Alceatraz/f80ea53d6971b6c6b772c8bafc1427ef to your computer and use it in GitHub Desktop.
A simple script to download container image
#!/usr/bin/env bash
name=$1
file=$1
file=$(sed "s#/#-#g" <<< "$file")
file=$(sed "s#:#-#g" <<< "$file")
file="$file.tar.gz"
docker pull "your.mirror.site/$name"
docker tag "your.mirror.site/$name" "$name"
docker save -o "$file" "$name"
echo "Image $name saved -> $file"
@Alceatraz
Copy link
Author

Download container image through NXMR and export it to tar package.

Then in another server which you need (K3S as demo):

k3s ctr -n k8s.io i import xxxx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment