I want to move all images with tags.
```
OUT=$(docker images --format '{{.Repository}}:{{.Tag}}')
OUTPUT=($OUT)
docker save $(echo "${OUTPUT[*]}") -o /dir/images.tar
```
Explanation:
First OUT
gets all tags but separated with new lines. Second OUTPUT
gets all tags in an array. Third $(echo "${OUTPUT[*]}")
puts all tags for a single docker save
command so that all images are in a single tar.
Additionally, this can be zipped using gzip. On target, run:
tar xvf images.tar.gz -O | docker load
-O
option to tar
puts contents on stdin which can be grabbed by docker load
.