I am using Docker version
Client:
Version: 17.12.1-ce
API version: 1.35
Go version: go1.9.4
Git commit: 3dfb8343b139d6342acfd9975d7f1068b5b1c3d3
Built: Tue Apr 3 23:37:44 2018
OS/Arch: linux/amd64
Server:
Engine:
Version: 17.12.1-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.9.4
Git commit: 7390fc6/17.12.1-ce
Built: Tue Apr 3 23:38:52 2018
OS/Arch: linux/amd64
Experimental: false
I used docker save to get the image in tar. unzipped the tar image and zipped again to tar file. The docker load doesnt work . It gives the following error;
open /var/lib/docker/tmp/docker-import-776730007/tomcat/json: no such file or directory
Steps to reproduce:
docker pull tomcat:latest
sudo docker save tomcat:latest > /tmp/docker/tomcat_latest.tar
sudo tar -C /tmp/docker/tomcat -xvf /tmp/docker/tomcat_latest.tar
sudo tar czf /tmp/docker/tomcat_latest.tar /tmp/docker/tomcat_latest
sudo docker load -i /tmp/docker/tomcat_latest.tar
open /var/lib/docker/tmp/docker-import-776730007/tomcat/json: no such file or directory
Tried to use;
cat tomcat_tar.tar | docker import - tomcat:latest
but it creates a new tomcat image. But I dont want to have a new tomcat image.
If I dont untar the tar file, and continue executing the docker load, it works. But I wanted to untar the tar image. I understand that untar the image changes the structure of the image. Is there any safer command to untar the docker image, or how does the docker save create the tar file internally.