0

I am new to docker. So what I want to have is a pgadmin container which I can pull and have always my configs and connections up to date. I was not really sure how to do that, but can I have a Volume which is alsways shared for example on my Windows PC at home and on work? I couldt find an good tutorial for that and dont know if that makes sense. Lets say my computer would be stolen I just want to install docker and my images and fun.

Matthias
  • 485
  • 7
  • 21

2 Answers2

1

That's not something you can do with Docker itself. You can only push images to DockerHub, which do not contain information that you added to a container during an execution.

What you could do is using a backup routine to S3 for example, and sync your 'config and connections' between your docker container running on your home PC and work one.

dzang
  • 2,160
  • 2
  • 12
  • 21
1

What about a shared directory using DropBox ? as far as i know that the local dropbox directories always synced with the actual dropbox account which means you can have the config up to date for all of your devices.

Alternatively you can save the configuration - as long as it does not contain sensitive data - on a git repository which you can clone it then start using it. Both cases can be used as volumes in docker.

Mostafa Hussein
  • 11,063
  • 3
  • 36
  • 61
  • So it is basically possible to map a Windows path like from OneDrive into a Container linux path like pga Admin? – Matthias Mar 20 '19 at 15:06
  • I have not tried OneDrive in specific but if it works the same then Yes, in a normal situations you can mount a local path from the host to the container. – Mostafa Hussein Mar 20 '19 at 15:08
  • Getting more specific: What I am dreaming about is to have a docker image from pgadmin which looks into persient volume where it finds f.e. pg_hba.conf an some more confs. If I have to have the files on my host and synced via DropBox its fine for me. I just want to pull my image, make a container, sync my Box... ready. – Matthias Mar 20 '19 at 15:15
  • Yes, this is exactly what i meant by my answer. so if you have whatever service that can sync local directory to your account vise-versa and your image mounts /path/to/shared/directory then you can do it, just keep the same shared folder at the same path on same devices to avoid modification in the path – Mostafa Hussein Mar 20 '19 at 15:26
  • 1
    @Matthias if the answer accepted for your case then please don't forget to mark the question as answered, if you would like more explanation or have other concerns let me know – Mostafa Hussein Mar 20 '19 at 16:39