Transfer/Move a Docker Image
Using Export Command
Sample: osslab-dekiwiki
docker run -d -p 8880:80 \
-v /etc/localtime:/etc/localtime:ro \
-v $PWD/vol/data:/data \
-v $PWD/vol/var-lib-mysql:/var/lib/mysql \
-v $PWD/vol/var-log-httpd:/var/log/httpd \
-v $PWD/vol/var-log-dekiwiki:/var/log/dekiwiki \
-v $PWD/vol/var-www-dekiwiki-attachments:/var/www/dekiwiki/attachments \
-v $PWD/vol/var-www-dekiwiki-bin-cache:/var/www/dekiwiki/bin/cache \
--name $NAME \
osslab-dekiwiki \
/bin/bash
Run the instance in detach mode
docker run -it --detach --name osslab-mig osslab-dekiwiki
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
673f45c27a8b osslab-dekiwiki "/bin/sh -c /startup…" 5 seconds ago Up 4 seconds 80/tcp osslab-mig
Export theDocker imageContainer
docker export 673f45c27a8b > osslab-mig.tar
ls -l
-rw-r--r-- 1 root root 1143085568 Feb 27 14:21 osslab-mig.tar
Import Docker Container
tar -c osslab-mig.tar | docker import - osslab-dekiwiki