forked from korseby/container-metfrag
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path_run.sh
executable file
·64 lines (42 loc) · 1.52 KB
/
_run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# Make sure to add the following entry in /etc/default/grub:
#GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
# Name
NAME="korseby/metfrag"
# CPU options
#CPU_SHARES="--cpu-shares=8"
#CPU_SETS="--cpuset-cpus=0-$[$CPU_SHARES-1]"
#CPU_MEMS="--cpuset-mems=0"
#MEM="--memory=8g"
# Ports
PORT_PUB=9003
PORT_DOCKER=8080
# Volumes
VOL="-v $PWD/settings.properties:/usr/src/MetFragRelaunched/MetFragWeb/src/main/webapp/resources/settings.properties"
# Copy local settings file to project
cp /vol/metfragweb/settings.properties .
# Run docker
#docker run -i -t -d -p ${PORT_PUB}:${PORT_DOCKER} $VOL $CPU_SHARES $CPU_SETS $CPU_MEMS $MEM --name="$(echo ${NAME} | sed -e 's/.*\///')-run" $NAME
docker-compose -f docker-compose.yaml up -d
docker-compose scale metfrag=2
# Detach/Attach docker
# detach: CTRL-P + CTRL-Q
# Start and attach docker (you can also use docker start -ai instead)
#docker start ${NAME}-run
#docker attach ${NAME}-run
# Start shell inside running docker
#docker exec -i -t ${NAME}-run /bin/bash
# Start failed container with different entrypoint
#docker run -ti --entrypoint=/bin/bash ${NAME}-run
# Commit changes locally
#docker commit ${NAME}-run
# Show docker container and images
#docker ps -a
#docker images
# Delete container and image
#docker rm ${NAME}-run
#docker rmi ${NAME}
# Delete exited containers
#docker rm $(docker ps -a -f status=exited | grep -v CONTAINER\ ID | awk '{print $1}')
# Delete intermediate/untagged images
#docker rmi $(docker images | grep '^<none>' | awk '{print $3}')