Change volume mapping on Docker via command line


Recommended Posts

Hi all,

I have Hamachi Logmein running in a docker container, but it has no webui and no "Edit" menu in the dropdown list when clicking on the Hamachi icon. There is currently one volume mapping:

 

/config <-> /mnt/cache/appdata/Hamachi/

 

However I'd like to change that mapping to:

 

/config <-> /mnt/disks/TemporarySSD/Docker/Hamachi (Docker)

 

This change has to be done in the command line, but I'm not confident in my skills to make the change. Note, the name of the Logmein docker is simply "Hamachi". Can anyone walk me through the process? I can't imagine its overly difficult. Thank you in advance!

Link to comment

I have every other docker container running on a solid state drive outside of the array. The Hamachi docker works just fine on the cache drive, but I'd like it to be consistent and store all dockers on the solid state, partially because the cache drive spins up whenever I use Hamachi.

 

I'd like to change the location of the config, but there is no way to edit the mapping when I click on the docker. See the attached photo.

 

Currently I'm thinking that I remove the docker container, and then readd it with the correct config location. I'm just concerned that it might not work correctly anymore, especially because the initial installation procedure was incredibly difficult since the container isn't actively updated or compatible anymore.

Capture.PNG.893803b070a642c678cd066f99574c14.PNG

Link to comment

Thank you all for your help! I discovered out how to do this thanks to your helpful words. I'd like to document how I completed it, partially just for me and partially for anyone else who may be trying this.

 


 

Note: I initially installed the docker via command line with the following instruction (source: http://lime-technology.com/forum/index.php?topic=39209.msg424486#msg424486):

 

docker run -d --name="Hamachi" --net="host" --privileged="true" -e ACCOUNT="[email protected]" -v "/mnt/cache/Apps/Hamachi/":"/config":rw -v "/etc/localtime":"/etc/localtime":ro gfjardim/hamachi

 

I accidentally forgot to change the "config" mapping and wanted it on a different drive other than the cache drive. These are the steps to move it to the other drive.

 

First, I copied all of the config files from the existing Hamachi installation location to a backup. As per Squid's instruction, I removed the docker that I created via command line. I then recreated the docker using the webui and specified the following parameters when creating it. I had to manually create the variable "ACCOUNT" and path "/config".

 

Name: Hamachi
Repository: gfjardim/hamachi
Network type: Host
Priveleged: on
Container variable "ACCOUNT": [email protected]
Container path "/config": /mnt/disks/TemporarySSD/Docker/Hamachi (Docker)/

 

Then I created the docker, and copied the files I backed up earlier to my new installation location and overwrote the existing ones.

 

Those steps should allow you to move your docker, and by creating it via the webui, you can now change the container paths without headache.

 

Thanks again everyone for your help!

Link to comment
  • 3 months later...

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.