Docker – there’s no way to import a container (which wouldn’t make sense as it’s a running environment) as we saw export gives us a file system import takes this file system and imports it as an image which can run as is or serve as a layer for other images

┌──(root💀vm-iot-jsho-docker-01)-[~]
└─# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE

┌──(root💀vm-iot-jsho-docker-01)-[~]
└─# ls -la
insgesamt 147124
drwx—— 5 root root 4096 14. Feb 14:16 .
drwxr-xr-x 19 root root 4096 14. Feb 12:08 ..
-rw-r–r– 1 root root 4503 5. Feb 20:07 .bashrc
drwx—— 3 root root 4096 6. Feb 16:16 .cache
drwx—— 2 root root 4096 10. Feb 14:35 .docker
drwxr-xr-x 29 root root 4096 10. Feb 15:03 docker-images
-rw-r–r– 1 root root 11656 5. Feb 20:12 .face
lrwxrwxrwx 1 root root 11 5. Feb 21:09 .face.icon -> /root/.face
-rw-r–r– 1 root root 0 5. Feb 20:33 .hushlogin
-rw-r–r– 1 root root 148 4. Nov 21:24 .profile
-rw——- 1 root root 75307008 14. Feb 14:16 ubuntu.20210214.tar
-rw-r–r– 1 root root 75282944 14. Feb 12:08 ubuntu-iot-jsho-01.20210214.tar
-rw——- 1 root root 5918 14. Feb 13:05 .zsh_history
-rw-r–r– 1 root root 8063 5. Feb 20:07 .zshrc

┌──(root💀vm-iot-jsho-docker-01)-[~]
└─# docker import ubuntu-iot-jsho-01.20210214.tar ubuntu-iot-jsho-01:latest
sha256:cfd9ba654e827c5606f8f1dec0578a0ffd7920aff001fb52c29cd7b2434705f4

┌──(root💀vm-iot-jsho-docker-01)-[~]
└─# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu-iot-jsho-01 latest cfd9ba654e82 7 seconds ago 72.9MB

┌──(root💀vm-iot-jsho-docker-01)-[~]
└─#

Leave a Reply

You must be logged in to post a comment.