-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,28 @@ | ||
|
||
|
||
### build image | ||
docker build -t cmssw/couchdb . | ||
|
||
### list images | ||
docker images | ||
|
||
### list of running containers | ||
docker ps --no-trunc -aq | ||
|
||
### remove all running containers | ||
docker rm -f `docker ps --no-trunc -aq` | ||
|
||
### run given image | ||
docker run --rm -h `hostname -f` -v /tmp/vk:/etc/secrets -i -t cmssw/couchdb /bin/bash | ||
|
||
### remove existing image | ||
docker rmi cmssw/couchdb | ||
|
||
### inspect running container | ||
docker ps # find docker id | ||
docker inspect <docker_id> | grep IPAddress | ||
|
||
### push image to docker.com | ||
docker push cmssw/couchdb | ||
|
||
### references | ||
https://stackoverflow.com/questions/18497688/run-a-docker-image-as-a-container#18498313 | ||
https://stackoverflow.com/questions/17236796/how-to-remove-old-docker-containers#17237701 | ||
http://goinbigdata.com/docker-run-vs-cmd-vs-entrypoint/ | ||
### CouchDB image construction | ||
Image is built with the expected `_couchdb` user, also used to run the service. | ||
* latest version has been tagged as `3.2.2-stable`. | ||
* **configuration**: available under `/data/srv/auth/couchdb/`, | ||
* **database**: both database and views are available under `/data/srv/state/couchdb/database/`. | ||
* **couchapps**: couchapps libraries and code is available under `/data/srv/state/couchdb/stagingarea/`. | ||
* **logs**: finally, service logs can be found at `/data/srv/logs/couchdb/`. | ||
|
||
### Run CouchDB container | ||
Connect to the cmsweb backend VM with the cmsweb account and: | ||
``` | ||
cd /data/srv | ||
curl https://raw.githubusercontent.com/dmwm/CMSKubernetes/ffb19657b8a768b5a03557bb97021006270fb28b/docker/couchdb/docker-run.sh > docker-run.sh | ||
chmod +x docker-run.sh | ||
./docker-run.sh | ||
``` | ||
|
||
### Stop CouchDB container | ||
Connect to the cmsweb backend VM with the cmsweb account and: | ||
``` | ||
docker stop couchdb | ||
docker rm couchdb | ||
``` | ||
|
||
### Checking status of CouchDB service | ||
``` | ||
docker exec -it couchdb sh -c "/data/srv/current/config/couchdb/manage status" | ||
``` |