Project

General

Profile

Download (2.2 KB) Statistics
| Branch: | Tag: | Revision:
1
# CDM Server Docker Container
2

    
3
## Requirements
4

    
5
Install the latest version of Docker (you will need at least version 18.09.0, earlier versions might work also but are untested). Instructions on the installation process for various operation systems are found at https://docs.docker.com/install/
6

    
7
NOTE: On linux you may want to add your user to the docker group (https://docs.docker.com/install/linux/linux-postinstall/):
8

    
9
    sudo usermod -aG docker $USER
10
    
11
Log out and in afterwards to update the group membership.
12

    
13
If you plan to use docker-compose install it now: https://docs.docker.com/compose/install/
14

    
15
## Build docker container manually
16

    
17
## with the `docker` command
18

    
19
In the root of the cdm-server project execute:
20

    
21
    docker build --tag=cybertaxonomy/cdm-server:${version} -f src/main/docker/${project.version}/Dockerfile.dev ./
22

    
23
e.g.
24
  
25
    docker build --tag="cybertaxonomy/cdm-server:5.5.0-SNAPSHOT" -f src/main/docker/production/Dockerfile.dev ./
26
    
27
### with maven
28

    
29
    mvn docker:build
30

    
31
## Running the image 
32

    
33
### with docker
34

    
35
Running the cdmserver docker container as developer
36

    
37
Expects the datasource file as `datasources-cdm-server.xml` (see cdm-server-dev.env)
38

    
39
NOTE: If you are using **symlinks** in the `.cdmLibrary` these must be use path outside of this folder. Otherwise they mioght not be valid inside the container
40

    
41
    docker run -dit --restart unless-stopped \
42
        -p 8080:8080 \
43
        -h cdmserver-dev \
44
        --env-file=src/main/docker/production/cdm-server-dev.env \
45
        --mount type=bind,source=$HOME/.cdmLibrary,destination=/data/.cdmLibrary \
46
        --mount type=bind,source=$(pwd)/,destination=/var/log/cdmserver \
47
        cybertaxonomy.org/cdm-server:${version}
48
    
49
### with docker-compose
50

    
51
Run as detached service 
52

    
53
    docker-compose up -d
54
    
55
this starts the containers in the background and leaves them running.
56

    
57
Run and inspect the running container with the bash shell
58

    
59
    docker-compose run cdmserver /bin/bash
60

    
61

    
62

    
63
### with maven
64

    
65
    ...
66

    
67
## Shell access to the running docker container
68

    
69
1. find the `CONTAINER ID` or container name
70

    
71
    docker ps
72
    
73
1. Start the shell inside the container
74

    
75
    docker exec -it $CONAINER_ID|$CONTAINER_NAME /bin/bash
76

    
77
-i : --intertactive, -t: --tty
(3-3/8)