Jump to content

How to clone an existing docker (NOT install a second fresh copy)


Recommended Posts

Dear all

 

I want to know how I can clone an existing docker so that I have 2 copies of the same docker running.

I DO NOT want to install a fresh copy of the same docker (i have successfully done that by changing the name of the existing docker, and then installing agian using different ports).

I have spent a lot of time and effort to configure a docker running RStudio. Now I want a second copy of that docker, but do not want to spend all that time configuring it again.

 

So, the question is: How can I clone an existing docker so that I have 2 copies of it.

 

Regards

Link to comment

Looking at it objectively

 

  • The name HAS to be different.  No way around it.
  • If you're running in bridge mode, then the PORTS have to be different.  Only one app can listen on a given port at a time
  • If you're running in host mode, then you have to reconfigure the configuration within the app to reference a different port on one of the instances.  (See next point)
  • If the appdata for both instances point to the same config folder, then any config changes on one of the instances takes effect on both of them (ie: negates point above)
  • If you run each app on it's own IP address, then technically yes you could completely share everything (except the name).  BUT, then you would run into a caveat where each app *may* expect to have exclusive access to the appdata, and any changes one makes to it (saving metadata etc) may have unexpected consequences on the other instance since that instance may not be in a state that it will understand why what it assumes is it's appdata (that it assumes it has exclusive access to) suddenly for no reason just up and changed on it.  YMMV

 

Link to comment

Hey @Squid. Thanks so much for your inputs!

 

I do understand that the names and ports have to be different. I am happy to do that.

Actually, I also installed a lot of Linux packages in the actual docker itself, so probably just sharing the appdata wont help duplicate the docker (or would it?). 

I do not expect any further changes to the docker, so i don't mind if they are completely independent of each other. I do not want a LIVE clone, just a clone.

This could also maybe be helpful in case someone wants to copy a docker as it is to another system/platform.

 

SO, is there any way (however complicated) to do it?

 

PS: As a side question (off topic, if allowed): if I install a linux package in one docker, does it automatically become available in ALL dockers?

 

Regards

Rishi

Link to comment

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.

×
×
  • Create New...