Jump to content
chris1259

Move docker images to another unRaid server

15 posts in this topic Last Reply

Recommended Posts

Both servers are unRaid v6.6.6

 

Is this possible?

Is everything needed contained within the docker image? Or are there additional directories/files that also need to be transferred.

 

Thank You.

Share this post


Link to post

I made some headway.

 

Open a terminal and change to the dir you want to save the image.

 

# Display a list of installed docker images.
docker ps

 

# Use the name of the docker image and zip it up.
docker export PlexMediaServer | gzip > PlexMediaServer.tar.gz

 

# Copy it to the new server.

 

# Open a terminal and change to the directory where you saved the tar.gz file on the new server.

# Import the docker image. The name, plexmediaserver, must be in lower case.

zcat PlexMediaServer.tar.gz | docker import - plexmediaserver

 

Now checking the Docker tab in unRaid i see this.

 

image.png.99d709a6c928d22d7b1a10c76a982b18.png

 

# Launch the docker container.

 

docker run -i -t plexmediaserver /bin/bash

 

image.thumb.png.41814641592df492b9612596172748c9.png

 

But there is no way to connect to it or edit it.

 

image.png.d9f466abc45092da64d5502e18c780ee.png

 

Share this post


Link to post
3 hours ago, chris1259 said:

Both servers are unRaid v6.6.6

 

Is this possible?

Is everything needed contained within the docker image? Or are there additional directories/files that also need to be transferred.

 

Thank You.

Normally the docker images only contain the binaries - all variable data is external to the docker.    The normal place to configure for this variable data is under the appdata share, although it is up to the user where such data is placed.

Share this post


Link to post

Easiest solution is to just copy across your /appdata share and then repull the containers from Docker hub.  Just make sure your volume mounts are still valid on the second server.

 

You could also copy across the XML files from your flash to have easy access to the templates as you've configured them.

 

Essentially there are only two points in the docker ecosystem on Unraid where the data is custom to your install.  Appdata and XML files.

 

Personally I'd just copy across the appdata and recreate the containers manually so you can still leverage CA for reinstalling/management.

Edited by CHBMB

Share this post


Link to post
Just now, CHBMB said:

Easiest solution is to just copy across your /appdata share and then repull the containers from Docker hub.

That's what i was hoping for. I see this /mnt/%username%/appdata/PlexMediaServer/. I will try what you suggested.

Share this post


Link to post

Huh, it should be /mnt/user/appdata

Share this post


Link to post

There is no need to copy or transfer the docker image. Its contents, which is just the executable code for each container, are downloaded when a docker is installed or updated. What might be worthwhile transferring is the appdata for your dockers, and the templates for each. Probably you already know where the appdata is. The templates are on flash in config/plugins/dockerMan/templates-user. The templates contain the settings for each container, which is all those things you have to fill out when you create or edit a container, such as the mappings, etc.

Share this post


Link to post
1 minute ago, CHBMB said:

Huh, it should be /mnt/user/appdata

i was using %username% as a variable in this case.

Share this post


Link to post

But it isn't a variable.

 

I'm not being arsey, just want to ensure you understand the file structure before you start copying stuff to /mnt/chris1259/appdata and find yourself wondering where it all went when you restarted your server, as I think it would be in RAM and "poof" disappear.

Edited by CHBMB

Share this post


Link to post
1 minute ago, CHBMB said:

But it isn't a variable.

I didn't want to assume that everyone had "user" in their path.

Share this post


Link to post
Just now, chris1259 said:

I didn't want to assume that everyone had "user" in their path.

They do, it's part of the filesystem.

Share this post


Link to post

One easy way to do it, power down the server with your appdata on (which should all be on a cache disk, not sure I'd try this with a BTRFS pool)  and mount it in the new server with unassigned devices, then copy from disk to array.  (Make sure you copy rather than move!! And I'd probably back it up on server 1 before doing this as well, can't be too careful.)

Share this post


Link to post
55 minutes ago, chris1259 said:

I didn't want to assume that everyone had "user" in their path.

All user shares are mounted in /mnt/user. Simple as that.

Share this post


Link to post

I ended not moving the dockers and would suggest having a tab open on each server to transfer the settings over manually.

 

All the attempts to copy over the appdata directory were unsuccessful as i didn't want to remove the cache drive from the server. So no matter what i tried, i was struck with symbolic link errors, rights errors, copy errors, you name it.

 

But thanks for trying to help.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.