forked from grahamgilbert/Crypt-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker.sh
More file actions
executable file
·42 lines (36 loc) · 1.14 KB
/
docker.sh
File metadata and controls
executable file
·42 lines (36 loc) · 1.14 KB
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
#!/bin/bash
CWD=`pwd`
# if [ ! -d "$CWD/Data" ] ; then
# echo "Script must be run from root of crypt directory"
# exit 1
# fi
# Check that Docker Machine exists
# --vmwarefusion-boot2docker-url "https://github.com/boot2docker/boot2docker/releases/download/v1.8.2/boot2docker.iso"
if [ -z "$(docker-machine ls | grep crypt)" ]; then
docker-machine create -d vmwarefusion --vmwarefusion-disk-size=500000 --vmwarefusion-memory-size=2048 --vmwarefusion-cpu-count=4 crypt
docker-machine env crypt
eval "$(docker-machine env crypt)"
fi
# Check that Docker Machine is running
if [ "$(docker-machine status crypt)" != "Running" ]; then
docker-machine start crypt
docker-machine env crypt
eval "$(docker-machine env crypt)"
fi
# Get the IP address of the machine
IP=`docker-machine ip crypt`
# Clean up
docker ps -aq | xargs docker rm -f
KEYSET=$CWD/keyset
docker build -t "macadmins/crypt-server" $CWD
docker run -d \
--name="crypt" \
-e ADMIN_PASS='password' \
-v $KEYSET:/home/app/crypt/keyset \
--restart="always" \
-p 8000:8000 \
macadmins/crypt-server
echo
echo "### Your Docker Machine IP is: $IP"
echo
echo `docker-machine env crypt`