File tree Expand file tree Collapse file tree 6 files changed +26
-3
lines changed Expand file tree Collapse file tree 6 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,9 @@ if [ $# = 0 ] ; then
4646 exit 1
4747fi
4848
49- if [ -z " $USE_LXC " ]; then
49+ if [ -n " $USE_DOCKER " ]; then
50+ docker cp gitian-target:" /home/$TUSER /$1 " $2
51+ elif [ -z " $USE_LXC " ]; then
5052 src=" ${1%/ } " # remove trailing / which triggers special rsync behaviour
5153 rsync --checksum -a $QUIET_FLAG -e " ssh -oConnectTimeout=30 -oNoHostAuthenticationForLocalhost=yes -i ${GITIAN_BASE:- .} /var/id_rsa -p $VM_SSH_PORT " " $TUSER @localhost:${src} " " $2 "
5254else
Original file line number Diff line number Diff line change @@ -46,7 +46,10 @@ if [ $# = 0 ] ; then
4646 exit 1
4747fi
4848
49- if [ -z " $USE_LXC " ]; then
49+ if [ -n " $USE_DOCKER " ]; then
50+ docker exec -u $TUSER gitian-target mkdir -p " /home/$TUSER /$2 "
51+ docker cp " $1 " gitian-target:" /home/$TUSER /$2 "
52+ elif [ -z " $USE_LXC " ]; then
5053 src=" ${1%/ } " # remove trailing / which triggers special rsync behaviour
5154 rsync --checksum -a $QUIET_FLAG -e " ssh -oConnectTimeout=30 -oNoHostAuthenticationForLocalhost=yes -i ${GITIAN_BASE:- .} /var/id_rsa -p $VM_SSH_PORT " " ${src} " " $TUSER @localhost:$2 "
5255else
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ if [ -n "$USE_LXC" ]; then
99 VMSW=LXC
1010elif [ -n " $USE_VBOX " ]; then
1111 VMSW=VBOX
12+ elif [ -n " $USE_DOCKER " ]; then
13+ VMSW=DOCKER
1214fi
1315
1416usage () {
@@ -66,4 +68,7 @@ case $VMSW in
6668 VBOX)
6769 VBoxManage snapshot " Gitian-${SUITE} -${ARCH} " restore " Gitian-Clean"
6870 ;;
71+ DOCKER)
72+ true # Docker doesn't need to do anything
73+ ;;
6974esac
Original file line number Diff line number Diff line change 4646# exit 1
4747# fi
4848
49- if [ -z " $USE_LXC " ]; then
49+ if [ -n " $USE_DOCKER " ]; then
50+ docker exec -u $TUSER -i gitian-target $*
51+ elif [ -z " $USE_LXC " ]; then
5052 ssh -oConnectTimeout=30 -oNoHostAuthenticationForLocalhost=yes -i ${GITIAN_BASE:- .} /var/id_rsa -p $VM_SSH_PORT $TUSER @localhost $*
5153else
5254 config-lxc
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ if [ -n "$USE_LXC" ]; then
1010 VMSW=LXC
1111elif [ -n " $USE_VBOX " ]; then
1212 VMSW=VBOX
13+ elif [ -n " $USE_DOCKER " ]; then
14+ VMSW=DOCKER
1315fi
1416
1517case $VMSW in
@@ -34,4 +36,7 @@ case $VMSW in
3436 VBoxManage startvm " Gitian-${2} " --type headless
3537 echo " Gitian-${2} " > var/target.vmname
3638 ;;
39+ DOCKER)
40+ docker run -d --name gitian-target base-$SUFFIX :latest > /dev/null
41+ ;;
3742esac
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ if [ -n "$USE_LXC" ]; then
55 VMSW=LXC
66elif [ -n " $USE_VBOX " ]; then
77 VMSW=VBOX
8+ elif [ -n " $USE_DOCKER " ]; then
9+ VMSW=DOCKER
810fi
911
1012case $VMSW in
@@ -30,4 +32,8 @@ case $VMSW in
3032 VBoxManage controlvm ` cat var/target.vmname` savestate
3133 rm var/target.vmname
3234 ;;
35+ DOCKER)
36+ docker container stop gitian-target > /dev/null
37+ docker container rm gitian-target > /dev/null
38+ ;;
3339esac
You can’t perform that action at this time.
0 commit comments