Move Docker Base location issues

    • OMV 3.x
    • Resolved
    • Move Docker Base location issues

      I'm testing this out in OMV 3. I have no clue why but every single time I try to post a new thread I get an error. But when I check the forum it posted, but removed the OMV version.

      I'm testing out moving all of my data from an old storage location to a new storage location and I'm having issues with moving the Docker data. I've tried numerous things and none of them are working.

      After creating a new Share Folder to use in the new location for Docker I've done the following

      In the docker plugin, shutdown all of my docker containers. Went to the settings tab, selected the new Shared Folder, then below it force Source Path I put in the location of the old Shared Folder, the destination path is already pre-fillled in with the new location. After, I clicked the copy button to copy the data over and waited. After I clicked the save button, then clicked the Apply button after it's come up. When going back to the Overview, all of my containers are in a constant restart loop.

      I've also tried...

      Shutdown all the containers, in the cli shutdown the docker service. Used rsync to copy from the old location to the new location preserving rights, acls,etc. Went back to the settings of docker, pointed it to the new location, saved, apply, same problem.

      One time I THOUGHT I had it working only to find out that even though the GUI said it was using the new location, upon checking closer, it wasn't. I noticed that under /var/lib/docker/OpenMediaVault/ the linked location was still the old one.

      Is there a very specific process to get this to work? I really don't want to have to trash my entire docker setup/config and start from scratch.
    • Storage path and driver is not an easy thing just to copy, especially changing drivers.
      If ext4 was the old and new fs with overlay I guess a copy command should be enough of course with docker service completely stopped. Drop down to cli to do this.
      Don't use the shared folder section in the plugin. Eventually that will be removed or at least better implemented in the future omv4.
      Instead use a symlink pointing from /var/lib/docker to whatever location you have want for docker.
      New wiki
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server
    • Hmmm, I've also just tried to delete a container and image that I was no longer using anymore. I deleted the folder it was using to store the configuration. After doing that I pulled a new version of the image, and created a new container. Pulling the image was fine, creation of the container was fine. But when trying to run the container it immediately exits and the state is dead.

      I've tried pulling new images I've never used before, same problem. I'm starting to think this is more than just a copy issue. I might try removing the docker plugin and trying again.


      As for the symlinks. I did notice that when I change the configuration location, it changes the symlink at /var/lib/docker/OpenMediaVault to point to the new location....but /var/lib/docker doesn't change. At /var/lib/docker there is a handful of stuff there. Pretty much everything but an imagefolder, plugins, and tmp-old.
    • Could be that the storage location is borked
      The docker folder shouldn't have any manual intervention.

      The default location is /var/lib/docker

      If you want to start again and delete all images and container stop the docker service and disable.

      systemctl stop docker
      Systemctl disable docker

      Then remove

      /var/lib/docker folder

      Remove the plugin also. Edit fstab find a bind entry related to docker, if there is one delete it.
      Reboot

      Create a symlink for the docker default location. In /var/lib should look like this

      docker -> /media/dev-disk-by-label-do
      cker/docker

      Change the path according to your setup of course.

      Finally reinstall the plugin and enable. And don't use the path selector. I've already said this and you keep using it.
      New wiki
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server
    • Unfortunately after uninstalling, removing the entry in fstab, and creating the symlink, then installing docker, I'm getting errors upon installation. I've already manually uninstall and purged the packages, then tried again. This is what I got. Clipped off the top part as I didn't see any errors above this. I'm guessing there's still remnants left behind.

      Setting up docker-engine (17.05.0~ce-0~debian-jessie) ...
      Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details.
      invoke-rc.d: initscript docker, action "start" failed.
      dpkg: error processing package docker-engine (--configure):
      subprocess installed post-installation script returned error exit status 1
      Setting up php-symfony-class-loader (2.3.21+dfsg-4+deb8u3) ...
      Setting up omvextras-common (3.0.1) ...
      Setting up php5-curl (5.6.30+dfsg-0+deb8u1) ...
      php5_invoke: Enable module curl for cli SAPI
      php5_invoke: Enable module curl for fpm SAPI
      php5_invoke: Enable module curl for cgi SAPI
      Setting up php5-imagick (3.2.0~rc1-1) ...
      php5_invoke: Enable module imagick for cli SAPI

      >>> *************** Error ***************
      Bad Gateway
      <<< *************************************
      php5_invoke: Enable module imagick for fpm SAPI
      php5_invoke: Enable module imagick for cgi SAPI
      dpkg: dependency problems prevent configuration of openmediavault-docker-gui:
      openmediavault-docker-gui depends on docker-engine (>= 1.12); however:
      Package docker-engine is not configured yet.

      dpkg: error processing package openmediavault-docker-gui (--configure):
      dependency problems - leaving unconfigured
      Processing triggers for libc-bin (2.19-18+deb8u10) ...
      Processing triggers for openmediavault (3.0.88) ...
      Updating file permissions ...
      Purging internal cache ...
      Restarting engine daemon ...
      Processing triggers for php5-fpm (5.6.30+dfsg-0+deb8u1) ...
      Errors were encountered while processing:
      docker-engine
      openmediavault-docker-gui

      >>> *************** Error ***************

      <<< *************************************

      >>> *************** Error ***************


      <<< *************************************