forked from cloud-security-research/sgx-ra-tls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
container-build.sh
42 lines (36 loc) · 985 Bytes
/
container-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
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# Build project from scratch in a Docker container.
set -e
set -x
REPO_DIR=$(readlink -f .)
TEMP_DIR=$(mktemp -d /var/tmp/ratls-XXX)
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-i|--image)
IMAGE="$2"
shift # past argument
shift # past value
;;
-k|--keep)
CMD=" ; bash"
shift # past argument
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
pushd $TEMP_DIR
git clone $REPO_DIR
cd $(basename $REPO_DIR)
docker run --device=/dev/isgx --device=/dev/gsgx -v /var/run/aesmd:/var/run/aesmd \
-v$(pwd):/project \
-e https_proxy='https://proxy.jf.intel.com:912' \
-e http_proxy='http://proxy.jf.intel.com:911' \
-it $IMAGE bash -c "cd /project $CMD"
popd