mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
328dbd0aa2
Signed-off-by: Mary Anthony <mary@docker.com> Upding sed, adding script to avoid redirects, remove mkdos Signed-off-by: Mary Anthony <mary@docker.com> Ignoring graphics with sed Signed-off-by: Mary Anthony <mary@docker.com> Fixing kitematic image Signed-off-by: Mary Anthony <mary@docker.com> Removing draft Signed-off-by: Mary Anthony <mary@docker.com> Fixing link Signed-off-by: Mary Anthony <mary@docker.com> removing from the menu Signed-off-by: Mary Anthony <mary@docker.com> Updatiing order of project material Signed-off-by: Mary Anthony <mary@docker.com> Removing from Regsitry v2 content per Olivier Signed-off-by: Mary Anthony <mary@docker.com> tweaking the touchup Signed-off-by: Mary Anthony <mary@docker.com> Removing include; only used four places; hugo global var replace Signed-off-by: Mary Anthony <mary@docker.com> Entering fixes from page-by-page Signed-off-by: Mary Anthony <mary@docker.com>
1.7 KiB
1.7 KiB
Dockerizing a CouchDB service
Note
:
- If you don't like sudo then see Giving non-root access
Here's an example of using data volumes to share the same data between two CouchDB containers. This could be used for hot upgrades, testing different versions of CouchDB on the same data, etc.
Create first database
Note that we're marking /var/lib/couchdb
as a data volume.
$ COUCH1=$(docker run -d -p 5984 -v /var/lib/couchdb shykes/couchdb:2013-05-03)
Add data to the first database
We're assuming your Docker host is reachable at localhost
. If not,
replace localhost
with the public IP of your Docker host.
$ HOST=localhost
$ URL="http://$HOST:$(docker port $COUCH1 5984 | grep -o '[1-9][0-9]*$')/_utils/"
$ echo "Navigate to $URL in your browser, and use the couch interface to add data"
Create second database
This time, we're requesting shared access to $COUCH1
's volumes.
$ COUCH2=$(docker run -d -p 5984 --volumes-from $COUCH1 shykes/couchdb:2013-05-03)
Browse data on the second database
$ HOST=localhost
$ URL="http://$HOST:$(docker port $COUCH2 5984 | grep -o '[1-9][0-9]*$')/_utils/"
$ echo "Navigate to $URL in your browser. You should see the same data as in the first database"'!'
Congratulations, you are now running two Couchdb containers, completely isolated from each other except for their data.