move docker container to another host portainer code example
Example: move docker container from one host to another
docker stop $CONTAINER
docker commit $CONTAINER $CONTAINER
docker save -o $CONTAINER.tar $CONTAINER
docker-volumes.sh $CONTAINER save $CONTAINER-volumes.tar
scp $CONTAINER.tar $CONTAINER-volumes.tar $USER@$HOST:
docker load -i $CONTAINER.tar
docker create --name $CONTAINER [<PREVIOUS CONTAINER OPTIONS>] $CONTAINER
docker-volumes.sh $CONTAINER load $CONTAINER-volumes.tar
docker start $CONTAINER