Skip to content

Commit c0f1569

Browse files
author
MarcoFalke
committed
Merge #13368: Update gitian-build.sh for docker
86967b2 Add option to use docker for gitian-build.sh (Andrew Chow) Pull request description: Updates gitian-build.sh script for the docker virtualization method recently added to gitian-builder. Second commit depends on devrandom/gitian-builder#185 Tree-SHA512: 0fa50b6c1be35a7a39f4a82816369637d3d0082922ac9876b80ae8156c795dec0ff34ad384b5348777042df8ddb6a72bbaeddd7002ef80557b10e2acf46632aa
2 parents 8803c91 + 86967b2 commit c0f1569

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

contrib/gitian-build.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ url=https://github.com/bitcoin/bitcoin
2222
proc=2
2323
mem=2000
2424
lxc=true
25+
docker=false
2526
osslTarUrl=http://downloads.sourceforge.net/project/osslsigncode/osslsigncode/osslsigncode-1.7.1.tar.gz
2627
osslPatchUrl=https://bitcoincore.org/cfields/osslsigncode-Backports-to-1.7.1.patch
2728
scriptName=$(basename -- "$0")
@@ -49,6 +50,7 @@ Options:
4950
-j Number of processes to use. Default 2
5051
-m Memory to allocate in MiB. Default 2000
5152
--kvm Use KVM instead of LXC
53+
--docker Use Docker instead of LXC
5254
--setup Set up the Gitian building environment. Uses LXC. If you want to use KVM, use the --kvm option. Only works on Debian-based systems (Ubuntu, Debian)
5355
--detach-sign Create the assert file for detached signing. Will not commit anything.
5456
--no-commit Do not commit anything to git
@@ -157,6 +159,16 @@ while :; do
157159
--kvm)
158160
lxc=false
159161
;;
162+
# docker
163+
--docker)
164+
if [[ $lxc = false ]]
165+
then
166+
echo 'Error: cannot have both kvm and docker'
167+
exit 1
168+
fi
169+
lxc=false
170+
docker=true
171+
;;
160172
# Detach sign
161173
--detach-sign)
162174
signProg="true"
@@ -182,6 +194,12 @@ then
182194
export USE_LXC=1
183195
fi
184196

197+
# Setup docker
198+
if [[ $docker = true ]]
199+
then
200+
export USE_DOCKER=1
201+
fi
202+
185203
# Check for OSX SDK
186204
if [[ ! -e "gitian-builder/inputs/MacOSX10.11.sdk.tar.gz" && $osx == true ]]
187205
then
@@ -239,6 +257,10 @@ then
239257
then
240258
sudo apt-get install lxc
241259
bin/make-base-vm --suite trusty --arch amd64 --lxc
260+
elif [[ -n "$USE_DOCKER" ]]
261+
then
262+
sudo apt-get install docker-ce
263+
bin/make-base-vm --suite trusty --arch amd64 --docker
242264
else
243265
bin/make-base-vm --suite trusty --arch amd64
244266
fi

0 commit comments

Comments
 (0)