This post is more like a note to myself, but this may help if you are looking at How to Import & Export Docker Image.
Save / Export Docker Image
- Without Compression
# docker save image_name/id_image:tag > output_name
docker save nginx:latest > nginx.tar
2. With Compression
# docker save image_name/id_image:tag | gzip > output_name
docker save nginx:latest | gzip > nginx.tar.gz
Comparison of uncompressed nginx container images with gzip compression
rjhaikal:~# ls -lh nginx.tar nginx.tar.gz
-rw-r--r-- 1 ada ada 132M Feb 24 08:16 nginx.tar
-rw-r--r-- 1 ada ada 50M Feb 24 08:16 nginx.tar.gz
Load / Import Docker Image
# docker load < file_name
docker load < nginx.tar