Project

General

Profile

Download (1.97 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.eu/cdm-server:${version}
48
    
49
### with docker-compose
50

    
51
### with maven
52

    
53
    ...
54

    
55
## Shell access to the running docker container
56

    
57
1. find the `CONTAINER ID` or container name
58

    
59
    docker ps
60
    
61
1. Start the shell inside the container
62

    
63
    docker exec -it $CONAINER_ID|$CONTAINER_NAME /bin/bash
64

    
65
-i : --intertactive, -t: --tty
(3-3/7)