Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

cdm-server / src / main / docker / production / README.md @ b2c1eebc

History | View | Annotate | Download (2.13 KB)

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
Run as detached service 
52

    
53
    docker-compose run -d cdmserver
54

    
55
Run and inspect the running container with the bash shell
56

    
57
    docker-compose run cdmserver /bin/bash
58

    
59

    
60

    
61
### with maven
62

    
63
    ...
64

    
65
## Shell access to the running docker container
66

    
67
1. find the `CONTAINER ID` or container name
68

    
69
    docker ps
70
    
71
1. Start the shell inside the container
72

    
73
    docker exec -it $CONAINER_ID|$CONTAINER_NAME /bin/bash
74

    
75
-i : --intertactive, -t: --tty
Add picture from clipboard (Maximum size: 40 MB)