forked from rdkls/aws_infra_map_neo4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-docker-local-build.sh
executable file
·30 lines (26 loc) · 1.17 KB
/
run-docker-local-build.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
#!/usr/bin/env bash
NEO4J_AUTH='neo4j/paper'
if [ -z "$AWS_SECRET_ACCESS_KEY" ] ; then
# Get from files
AWS_SECRET_ACCESS_KEY=`grep aws_secret_access_key ~/.aws/credentials | head -n1 | cut -d'=' -f 2 | sed 's/ //g'`
AWS_ACCESS_KEY_ID=`grep aws_access_key_id ~/.aws/credentials | head -n1 | cut -d'=' -f 2 | sed 's/ //g'`
AWS_SESSION_TOKEN=`grep aws_session_token ~/.aws/credentials | head -n1 | cut -d'=' -f 2 | sed 's/ //g'`
AWS_SECURITY_TOKEN=`grep aws_security_token ~/.aws/credentials | head -n1 | cut -d'=' -f 2 | sed 's/ //g'`
fi
if [ -z "$AWS_REGION" ] ; then
AWS_REGION=`grep region ~/.aws/config | head -n1 | cut -d'=' -f 2 | sed 's/ //g'`
fi
docker rm -f neo4j_awless 2>/dev/null
docker build --tag aws_infra_map_neo4j:latest .
export AWS_TO_NEO4J_LIMIT_REGION=ap-southeast-2
docker run -ti \
--name neo4j_awless \
--env AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
--env AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
--env AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \
--env AWS_DEFAULT_REGION=$AWS_REGION \
--env AWS_TO_NEO4J_LIMIT_REGION=$AWS_TO_NEO4J_LIMIT_REGION \
--env NEO4J_AUTH=$NEO4J_AUTH \
-p 7474:7474 \
-p 7687:7687 \
aws_infra_map_neo4j